> ## Documentation Index
> Fetch the complete documentation index at: https://docs.macropay.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Benefit

> Delete a benefit.

> [!WARNING]
> Every grants associated with the benefit will be revoked.
> Users will lose access to the benefit.

**Scopes**: `benefits:write`



## OpenAPI

````yaml delete /v1/benefits/{id}
openapi: 3.1.0
info:
  title: Macropay API
  summary: Macropay HTTP and Webhooks API
  description: Read the docs at https://macropay.ai/docs/api-reference
  version: 0.1.0
servers:
  - url: https://api.macropay.ai
    description: Production environment
    x-speakeasy-server-id: production
  - url: https://sandbox-api.macropay.ai
    description: Sandbox environment
    x-speakeasy-server-id: sandbox
security:
  - access_token: []
tags:
  - name: public
    description: >-
      Endpoints shown and documented in the Macropay API documentation and
      available in our SDKs.
  - name: private
    description: >-
      Endpoints that should appear in the schema only in development to generate
      our internal JS SDK.
  - name: mcp
    description: Endpoints enabled in the MCP server.
paths:
  /v1/benefits/{id}:
    delete:
      tags:
        - benefits
        - public
      summary: Delete Benefit
      description: |-
        Delete a benefit.

        > [!WARNING]
        > Every grants associated with the benefit will be revoked.
        > Users will lose access to the benefit.

        **Scopes**: `benefits:write`
      operationId: benefits:delete
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The benefit ID.
            x-macropay-selector-widget:
              resourceRoot: /v1/benefits
              resourceName: Benefit
              displayProperty: description
            title: Id
      responses:
        '204':
          description: Benefit deleted.
        '403':
          description: This benefit is not deletable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotPermitted'
        '404':
          description: Benefit not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFound'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tmacropaygo \"github.com/web3group/macropay-go-main\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := macropaygo.New(\n        macropaygo.WithSecurity(os.Getenv(\"MACROPAY_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Benefits.Delete(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from macropay_sdk import Macropay


            with Macropay(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as macropay:

                macropay.benefits.delete(id="<value>")

                # Use the SDK ...
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Macropay } from "@macropayments/sdk";

            const macropay = new Macropay({
              accessToken: process.env["MACROPAY_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              await macropay.benefits.delete({
                id: "<value>",
              });


            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Macropay;

            $sdk = Macropay\Macropay::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->benefits->delete(
                id: '<value>'
            );

            if ($response->statusCode === 200) {
                // handle response
            }
components:
  schemas:
    NotPermitted:
      properties:
        error:
          type: string
          const: NotPermitted
          title: Error
          examples:
            - NotPermitted
        detail:
          type: string
          title: Detail
      type: object
      required:
        - error
        - detail
      title: NotPermitted
    ResourceNotFound:
      properties:
        error:
          type: string
          const: ResourceNotFound
          title: Error
          examples:
            - ResourceNotFound
        detail:
          type: string
          title: Detail
      type: object
      required:
        - error
        - detail
      title: ResourceNotFound
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    access_token:
      type: http
      scheme: bearer
      description: >-
        You can generate an **Organization Access Token** from your
        organization's settings.

````