---
title: "Create API Key"
method: POST
path: "/users/{user_id}/api_keys"
tags: ["users", "API Keys"]
---

# Create API Key

`POST /users/{user_id}/api_keys`

Create API Key

## Path parameters

- `user_id` integer, required

## Response `201`

The ApiKeys object.

- ApiKeyEntity — ApiKeyEntity model
  - `id` integer — API Key ID
  - `descriptive_label` string — Unique label that describes this API key. Useful for external systems where you may have API keys from multiple accounts and want a human-readable label for each key.
  - `description` string — User-supplied description of API key.
  - `created_at` string, date-time — Time which API Key was created
  - `expires_at` string, date-time — API Key expiration date
  - `key` string — API Key actual key string
  - `aws_style_credentials` boolean — If `true`, this API key will be usable with AWS-compatible endpoints, such as our Inbound S3-compatible endpoint.
  - `aws_access_key_id` string — AWS Access Key ID to use with AWS-compatible endpoints, such as our Inbound S3-compatible endpoint.
  - `aws_secret_key` string — AWS Secret Key to use with AWS-compatible endpoints, such as our Inbound S3-compatible endpoint.
  - `last_use_at` string, date-time — API Key last used - note this value is only updated once per 3 hour period, so the 'actual' time of last use may be up to 3 hours later than this timestamp.
  - `name` string — Internal name for the API Key. For your use.
  - `permission_set` 'none' | 'full' | 'desktop_app' | 'sync_app' | 'office_integration' | 'mobile_app' | 'files_only' — Permissions for this API Key. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Keys with the `office_integration` permission set are auto generated, and automatically expire, to allow users to interact with office integration platforms. Keys with the `files_only` permission set can perform file operations as a full-access file user in the key's workspace scope, but cannot use site admin, workspace admin, folder admin, group admin, partner admin, or billing privileges from the owning user.
  - `platform` string — If this API key represents a Desktop app, what platform was it created on?
  - `site_id` integer — Site ID
  - `site_name` string — Site Name
  - `url` string — URL for API host.
  - `user_id` integer — User ID for the owner of this API Key. May be blank for Site-wide API Keys.
  - `workspace_id` integer — Workspace ID for this API Key. `0` means the default workspace.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `405` — Method Not Allowed
- `409` — Conflict
- `412` — Precondition Failed
- `422` — Unprocessable Entity
- `423` — Locked
- `429` — Too Many Requests

---

[API](https://skmtc.net/files/apis/files-com-api.md) · [All operations](https://skmtc.net/files/apis/files-com-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/files/files-com-api/versions/c80c746637fd/schema)
