# Retrieve usage key (/api/usage-keys/get-usage-key)

`GET https://api.comecero.com/api/v1/usage/keys/{usage_key_id}`

Secret and trusted tokens with the resource read permission may retrieve metadata in their account and mode. Limited tokens are forbidden. Removed or expired overrides remain retrievable. Usage-key metadata never includes the secret or hash.

## Request parameters

### usage_key_id (path, required)



```json
{
  "type": "string"
}
```

## Response 200

Public metadata.

### application/json

Fields and constraints (JSON Schema):

```json
{
  "type": "object",
  "title": "usage_key",
  "description": "Lets your server send events to the usage meter at https://usage.comecero.com/v1/events. See https://docs.comecero.com/docs/usage-billing/usage-meter-api Default public fields are shown here. show and hide can omit default fields, except the root url. Stored recovery state is never public.",
  "properties": {
    "object": {
      "type": "string",
      "description": "Always usage_key."
    },
    "usage_key_id": {
      "type": "string",
      "description": "uk_ plus 32 characters."
    },
    "name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Your label."
    },
    "key_prefix": {
      "type": "string",
      "description": "The first characters of the key, to tell keys apart."
    },
    "status": {
      "type": "string",
      "description": "active or revoked.",
      "enum": [
        "active",
        "revoked"
      ]
    },
    "active_in_apollo": {
      "type": "boolean",
      "description": "Whether the usage meter takes events with this key now. For a new key it is false until the key reaches the meter (a few minutes at most). For a revoked key it stays true until the revoke reaches the meter."
    },
    "test": {
      "type": "boolean",
      "description": "true for apk_test_ keys."
    },
    "date_created": {
      "type": "string",
      "description": "When it was created.",
      "format": "date-time"
    },
    "date_revoked": {
      "type": [
        "string",
        "null"
      ],
      "description": "When it was revoked.",
      "format": "date-time"
    },
    "capabilities": {
      "type": "array",
      "minItems": 1,
      "maxItems": 2,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "enum": [
          "events:write",
          "entitlements:read"
        ]
      }
    },
    "url": {
      "type": "string",
      "format": "uri",
      "readOnly": true
    }
  },
  "example": {
    "object": "usage_key",
    "usage_key_id": "uk_5d1c0e7a9b2f4e6c8a0d3b5f7e9c1a2b",
    "name": "Production server",
    "key_prefix": "apk_live_8Hq2",
    "status": "active",
    "active_in_apollo": true,
    "test": false,
    "date_created": "2026-11-01T09:30:00Z",
    "date_revoked": null,
    "url": "https://api.comecero.com/api/v1/usage/keys/uk_5d1c0e7a9b2f4e6c8a0d3b5f7e9c1a2b",
    "capabilities": [
      "events:write"
    ]
  },
  "required": [
    "object",
    "url",
    "usage_key_id",
    "capabilities",
    "name",
    "key_prefix",
    "status",
    "active_in_apollo",
    "test",
    "date_created",
    "date_revoked"
  ],
  "additionalProperties": false
}
```

Example:

```json
{
  "object": "usage_key",
  "usage_key_id": "uk_5d1c0e7a9b2f4e6c8a0d3b5f7e9c1a2b",
  "name": "Production server",
  "key_prefix": "apk_live_8Hq2",
  "status": "active",
  "active_in_apollo": true,
  "test": false,
  "date_created": "2026-11-01T09:30:00Z",
  "date_revoked": null,
  "url": "https://api.comecero.com/api/v1/usage/keys/uk_5d1c0e7a9b2f4e6c8a0d3b5f7e9c1a2b",
  "capabilities": [
    "events:write"
  ]
}
```

## Response 400

Invalid input (type `bad_request`, usually code `invalid_input`). The message names the field or query parameter and why it was refused.

### application/json

Fields and constraints (JSON Schema):

```json
{
  "type": "object",
  "title": "error",
  "description": "Every error response has this body, whatever the status code. Use `status` and `type` for the broad case, `code` for the exact one, and show `message` to a person.",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "title": "error_details",
      "description": "The details of an error: `error` in every error response, and a failed row in a license import receipt.",
      "required": [
        "type",
        "code",
        "message",
        "reference",
        "status",
        "meta"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "The broad category. It matches `status`.",
          "enum": [
            "bad_request",
            "invalid_request",
            "unauthorized",
            "transaction_error",
            "forbidden",
            "not_found",
            "conflict",
            "unprocessable",
            "too_many_requests",
            "internal_server_error",
            "external_server_error",
            "service_unavailable",
            "external_server_timeout"
          ]
        },
        "code": {
          "type": [
            "string",
            "null"
          ],
          "description": "The exact error within its type, for example `invalid_input`, `invalid_token`, `payment_declined`, `insufficient_permissions`, `resource_not_found`, `in_use` or `invalid_state`. New codes may be added, so keep a fallback for each status.",
          "examples": [
            "invalid_input"
          ]
        },
        "message": {
          "type": [
            "string",
            "null"
          ],
          "description": "What went wrong and, often, how to fix it. Written for people, in the shopper's language where a translation exists. Do not parse it."
        },
        "reference": {
          "type": [
            "string",
            "null"
          ],
          "description": "A 7-character code (some newer ones are longer) that names the exact check in Comecero that refused the request. The same check always gives the same reference, so it is not unique to your request. Quote it when you contact support.",
          "examples": [
            "qh81SPw"
          ]
        },
        "status": {
          "type": "integer",
          "description": "The HTTP status code of the response.",
          "enum": [
            400,
            401,
            402,
            403,
            404,
            409,
            413,
            422,
            429,
            500,
            502,
            503,
            504
          ]
        },
        "meta": {
          "description": "More detail about the error when there is any, such as the payment that was declined. Usually `null`.",
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": true
        }
      }
    }
  },
  "example": {
    "error": {
      "type": "not_found",
      "code": "resource_not_found",
      "message": "Event not found: 0059847953278fQmIZHpIYdE does not exist.",
      "reference": "qh81SPw",
      "status": 404,
      "meta": null
    }
  }
}
```

Example:

```json
{
  "error": {
    "type": "bad_request",
    "code": "invalid_input",
    "message": "The value supplied for the url query string parameter 'limit' is invalid. The value must be between 1 and 100 or remove the parameter to use the default.",
    "reference": "2mJgF4F",
    "status": 400,
    "meta": null
  }
}
```

## Response 401

The token is missing, expired or not valid (type `unauthorized`, code `invalid_token`).

### application/json

Fields and constraints (JSON Schema):

```json
{
  "type": "object",
  "title": "error",
  "description": "Every error response has this body, whatever the status code. Use `status` and `type` for the broad case, `code` for the exact one, and show `message` to a person.",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "title": "error_details",
      "description": "The details of an error: `error` in every error response, and a failed row in a license import receipt.",
      "required": [
        "type",
        "code",
        "message",
        "reference",
        "status",
        "meta"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "The broad category. It matches `status`.",
          "enum": [
            "bad_request",
            "invalid_request",
            "unauthorized",
            "transaction_error",
            "forbidden",
            "not_found",
            "conflict",
            "unprocessable",
            "too_many_requests",
            "internal_server_error",
            "external_server_error",
            "service_unavailable",
            "external_server_timeout"
          ]
        },
        "code": {
          "type": [
            "string",
            "null"
          ],
          "description": "The exact error within its type, for example `invalid_input`, `invalid_token`, `payment_declined`, `insufficient_permissions`, `resource_not_found`, `in_use` or `invalid_state`. New codes may be added, so keep a fallback for each status.",
          "examples": [
            "invalid_input"
          ]
        },
        "message": {
          "type": [
            "string",
            "null"
          ],
          "description": "What went wrong and, often, how to fix it. Written for people, in the shopper's language where a translation exists. Do not parse it."
        },
        "reference": {
          "type": [
            "string",
            "null"
          ],
          "description": "A 7-character code (some newer ones are longer) that names the exact check in Comecero that refused the request. The same check always gives the same reference, so it is not unique to your request. Quote it when you contact support.",
          "examples": [
            "qh81SPw"
          ]
        },
        "status": {
          "type": "integer",
          "description": "The HTTP status code of the response.",
          "enum": [
            400,
            401,
            402,
            403,
            404,
            409,
            413,
            422,
            429,
            500,
            502,
            503,
            504
          ]
        },
        "meta": {
          "description": "More detail about the error when there is any, such as the payment that was declined. Usually `null`.",
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": true
        }
      }
    }
  },
  "example": {
    "error": {
      "type": "not_found",
      "code": "resource_not_found",
      "message": "Event not found: 0059847953278fQmIZHpIYdE does not exist.",
      "reference": "qh81SPw",
      "status": 404,
      "meta": null
    }
  }
}
```

Example:

```json
{
  "error": {
    "type": "unauthorized",
    "code": "invalid_token",
    "message": "Authentication failed.",
    "reference": "pre3XcJ",
    "status": 401,
    "meta": null
  }
}
```

## Response 403

The token does not have the applicable resource permission. Limited shopper tokens cannot call merchant usage billing routes. Credits are available to every shop.

### application/json

Fields and constraints (JSON Schema):

```json
{
  "type": "object",
  "title": "error",
  "description": "Every error response has this body, whatever the status code. Use `status` and `type` for the broad case, `code` for the exact one, and show `message` to a person.",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "title": "error_details",
      "description": "The details of an error: `error` in every error response, and a failed row in a license import receipt.",
      "required": [
        "type",
        "code",
        "message",
        "reference",
        "status",
        "meta"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "The broad category. It matches `status`.",
          "enum": [
            "bad_request",
            "invalid_request",
            "unauthorized",
            "transaction_error",
            "forbidden",
            "not_found",
            "conflict",
            "unprocessable",
            "too_many_requests",
            "internal_server_error",
            "external_server_error",
            "service_unavailable",
            "external_server_timeout"
          ]
        },
        "code": {
          "type": [
            "string",
            "null"
          ],
          "description": "The exact error within its type, for example `invalid_input`, `invalid_token`, `payment_declined`, `insufficient_permissions`, `resource_not_found`, `in_use` or `invalid_state`. New codes may be added, so keep a fallback for each status.",
          "examples": [
            "invalid_input"
          ]
        },
        "message": {
          "type": [
            "string",
            "null"
          ],
          "description": "What went wrong and, often, how to fix it. Written for people, in the shopper's language where a translation exists. Do not parse it."
        },
        "reference": {
          "type": [
            "string",
            "null"
          ],
          "description": "A 7-character code (some newer ones are longer) that names the exact check in Comecero that refused the request. The same check always gives the same reference, so it is not unique to your request. Quote it when you contact support.",
          "examples": [
            "qh81SPw"
          ]
        },
        "status": {
          "type": "integer",
          "description": "The HTTP status code of the response.",
          "enum": [
            400,
            401,
            402,
            403,
            404,
            409,
            413,
            422,
            429,
            500,
            502,
            503,
            504
          ]
        },
        "meta": {
          "description": "More detail about the error when there is any, such as the payment that was declined. Usually `null`.",
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": true
        }
      }
    }
  },
  "example": {
    "error": {
      "type": "not_found",
      "code": "resource_not_found",
      "message": "Event not found: 0059847953278fQmIZHpIYdE does not exist.",
      "reference": "qh81SPw",
      "status": 404,
      "meta": null
    }
  }
}
```

Example:

```json
{
  "error": {
    "type": "forbidden",
    "code": "insufficient_permissions",
    "message": "The supplied bearer token does not have permission to execute the provided HTTP method on the given resource.",
    "reference": "UbMetCr",
    "status": 403,
    "meta": null
  }
}
```

## Response 404

No such object (type `not_found`, code `resource_not_found`). It may belong to another account, or to the other mode: a test token cannot see live objects and a live token cannot see test ones. The message says so when the object exists in the other mode.

### application/json

Fields and constraints (JSON Schema):

```json
{
  "type": "object",
  "title": "error",
  "description": "Every error response has this body, whatever the status code. Use `status` and `type` for the broad case, `code` for the exact one, and show `message` to a person.",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "title": "error_details",
      "description": "The details of an error: `error` in every error response, and a failed row in a license import receipt.",
      "required": [
        "type",
        "code",
        "message",
        "reference",
        "status",
        "meta"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "The broad category. It matches `status`.",
          "enum": [
            "bad_request",
            "invalid_request",
            "unauthorized",
            "transaction_error",
            "forbidden",
            "not_found",
            "conflict",
            "unprocessable",
            "too_many_requests",
            "internal_server_error",
            "external_server_error",
            "service_unavailable",
            "external_server_timeout"
          ]
        },
        "code": {
          "type": [
            "string",
            "null"
          ],
          "description": "The exact error within its type, for example `invalid_input`, `invalid_token`, `payment_declined`, `insufficient_permissions`, `resource_not_found`, `in_use` or `invalid_state`. New codes may be added, so keep a fallback for each status.",
          "examples": [
            "invalid_input"
          ]
        },
        "message": {
          "type": [
            "string",
            "null"
          ],
          "description": "What went wrong and, often, how to fix it. Written for people, in the shopper's language where a translation exists. Do not parse it."
        },
        "reference": {
          "type": [
            "string",
            "null"
          ],
          "description": "A 7-character code (some newer ones are longer) that names the exact check in Comecero that refused the request. The same check always gives the same reference, so it is not unique to your request. Quote it when you contact support.",
          "examples": [
            "qh81SPw"
          ]
        },
        "status": {
          "type": "integer",
          "description": "The HTTP status code of the response.",
          "enum": [
            400,
            401,
            402,
            403,
            404,
            409,
            413,
            422,
            429,
            500,
            502,
            503,
            504
          ]
        },
        "meta": {
          "description": "More detail about the error when there is any, such as the payment that was declined. Usually `null`.",
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": true
        }
      }
    }
  },
  "example": {
    "error": {
      "type": "not_found",
      "code": "resource_not_found",
      "message": "Event not found: 0059847953278fQmIZHpIYdE does not exist.",
      "reference": "qh81SPw",
      "status": 404,
      "meta": null
    }
  }
}
```

Example:

```json
{
  "error": {
    "type": "not_found",
    "code": "resource_not_found",
    "message": "Event not found: 0059847953278fQmIZHpIYdE does not exist.",
    "reference": "qh81SPw",
    "status": 404,
    "meta": null
  }
}
```

Resolve remaining `$ref` pointers in /openapi.json.