# Revoke a code

> Source: /api-reference/partner/explorer/code-pools/revoke-code
> Revokes a single code that is still available. A code already assigned or redeemed cannot be revoked.
> Full spec: https://docs.journey.com/openapi/partner.v1.json

## `DELETE /v1/partner/code-pools/{poolRef}/codes/{code}`

```json
{
  "description": "Revokes a single code that is still available. A code already assigned or redeemed cannot be revoked.",
  "operationId": "codePoolsPartner_revokeCode",
  "parameters": [
    {
      "description": "The literal code value to revoke.",
      "in": "path",
      "name": "code",
      "required": true,
      "schema": {
        "type": "string"
      }
    },
    {
      "description": "Pool reference — the offer id backing the pool. Must match `^[A-Za-z0-9_-]{1,100}$`.",
      "in": "path",
      "name": "poolRef",
      "required": true,
      "schema": {
        "pattern": "^[A-Za-z0-9_-]{1,100}$",
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "Whether the code was revoked."
    },
    "400": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/PartnerErrorResponse"
          }
        }
      },
      "description": "Request validation failed. `errors` lists the offending fields."
    },
    "401": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/PartnerErrorResponse"
          }
        }
      },
      "description": "No usable credential. Send `Authorization: Bearer <jwt>` or `X-API-Key: jny_...`."
    },
    "403": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/PartnerErrorResponse"
          }
        }
      },
      "description": "The credential authenticated but lacks the scopes in `x-required-scopes`, or the resource belongs to another organization."
    },
    "404": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/PartnerErrorResponse"
          }
        }
      },
      "description": "No such resource, or it is outside the organization the credential resolves to."
    }
  },
  "security": [
    {
      "partnerBearer": []
    },
    {
      "partnerApiKey": []
    }
  ],
  "summary": "Revoke a code",
  "tags": [
    "partner/code-pools"
  ],
  "x-required-scopes": [
    [
      "offers:codes:write"
    ]
  ]
}
```