# Create a narrowly scoped API credential (/docs/api-reference/api/v1/sponsors/keys/post)

`POST https://mmb-blurware-alpha.vercel.app/api/v1/sponsors/keys`

Create a narrowly scoped API credential

Requires keys:manage. Account ownership and current admin membership are checked independently of key scopes. All times are UTC epoch milliseconds. List responses are cursor-paginated. Booking creation requires a UUID idempotencyKey; repeating it returns the same reservation. Browser sessions use the same service with same-origin mutation protection.

Operation ID: `sponsorship_keys_create`

OpenAPI document: https://mmb-blurware-alpha.vercel.app/openapi.json

## Authentication

Required bearer token: `Authorization: Bearer $MMB_API_KEY`.

## Request

### Request body — application/json (required)

```json
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64
    },
    "scopes": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "library:read",
          "sponsor:read",
          "sponsor:write",
          "billing:write",
          "admin:read",
          "admin:write",
          "keys:manage"
        ]
      },
      "minItems": 1,
      "maxItems": 7
    }
  },
  "required": [
    "name",
    "scopes"
  ],
  "additionalProperties": false
}
```

## Responses

### `200` — Response

**application/json**

```json
{
  "type": "object",
  "properties": {
    "apiKey": {
      "type": "string"
    },
    "id": {
      "type": "string"
    },
    "scopes": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "library:read",
          "sponsor:read",
          "sponsor:write",
          "billing:write",
          "admin:read",
          "admin:write",
          "keys:manage"
        ]
      }
    }
  },
  "required": [
    "apiKey",
    "id",
    "scopes"
  ]
}
```

### `400` — Response

**application/json**

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retryAfter": {
      "type": "number"
    }
  },
  "required": [
    "error",
    "message"
  ]
}
```

### `401` — Response

**application/json**

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retryAfter": {
      "type": "number"
    }
  },
  "required": [
    "error",
    "message"
  ]
}
```

### `403` — Response

**application/json**

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retryAfter": {
      "type": "number"
    }
  },
  "required": [
    "error",
    "message"
  ]
}
```

### `404` — Response

**application/json**

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retryAfter": {
      "type": "number"
    }
  },
  "required": [
    "error",
    "message"
  ]
}
```

### `409` — Response

**application/json**

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retryAfter": {
      "type": "number"
    }
  },
  "required": [
    "error",
    "message"
  ]
}
```

### `429` — Response

**application/json**

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retryAfter": {
      "type": "number"
    }
  },
  "required": [
    "error",
    "message"
  ]
}
```

### `503` — Response

**application/json**

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retryAfter": {
      "type": "number"
    }
  },
  "required": [
    "error",
    "message"
  ]
}
```