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

# createApiKey

> Creates a workspace API key and returns its token, once. The key can never do more than the calling key. Rotate a key by creating its successor, then revoking it. Needs `api_keys:write`.



**mutation** `createApiKey(input: CreateApiKeyInput!): CreateApiKeyPayload!`

## Arguments

**`input`**: `CreateApiKeyInput!` (required)

The key to create.

## Returns

`CreateApiKeyPayload!`

**`apiKey`**: `ApiKey!`

The new key.

---

**`token`**: `String!`

The key's bearer token. This is the only time it is shown; store it now.

## Examples

```graphql Mutation
mutation CreateApiKey($input: CreateApiKeyInput!) {
  createApiKey(input: $input) {
    apiKey {
      id
      name
      capabilities
      workspace {
        name
        uid
        createdAt
        dbtVersion
        supportedDbtVersions
        dbtPartialParsing
      }
      createdAt
      expiresAt
    }
    token
  }
}
```

```json Variables
{
  "input": {
    "name": "string",
    "capabilityGroups": [
      "VIEW_AUDIT_LOGS"
    ]
  }
}
```

```json Response
{
  "data": {
    "createApiKey": {
      "apiKey": {
        "id": "id",
        "name": "string",
        "capabilities": [
          "string"
        ],
        "workspace": {
          "name": "string",
          "uid": "string",
          "createdAt": "value",
          "dbtVersion": "string",
          "supportedDbtVersions": [
            "string"
          ],
          "dbtPartialParsing": true
        },
        "createdAt": "value",
        "expiresAt": "value"
      },
      "token": "string"
    }
  }
}
```


## Related topics

- [Administration API: API keys](https://docs.paradime.io/developers/graphql-api/admin-api/api-keys.md)
- [Administration API: Conventions](https://docs.paradime.io/developers/graphql-api/admin-api/conventions.md)
- [API Keys](https://docs.paradime.io/developers/api-keys.md)
- [Create Linear Issues](https://docs.paradime.io/guides/orchestrate-data-pipelines/templates/ticketing-templates/create-linear-issues.md)
- [Administration API](https://docs.paradime.io/developers/graphql-api/admin-api/index.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.