---
title: "POST /api/v3/accounts/{account_id}/users/{user_id}/account-apikeys/"
method: POST
path: "/api/v3/accounts/{account_id}/users/{user_id}/account-apikeys/"
tags: ["Users"]
---

# POST /api/v3/accounts/{account_id}/users/{user_id}/account-apikeys/

`POST /api/v3/accounts/{account_id}/users/{user_id}/account-apikeys/`

## Request

- Base URL: `https://cloud.getdbt.com`
- URL: `https://cloud.getdbt.com/api/v3/accounts/{account_id}/users/{user_id}/account-apikeys/`
- Auth: HTTP bearer

## Path parameters

- `account_id` integer, required
- `user_id` integer, required

## Request body

- AccountScopedPATRequestRequest
  - `name` string, required
  - `expires_at` string, date-time

## Response `200`

- DetailCreateAccountScopedPATResponse
  - `status` Status
    - `code` integer
    - `is_success` boolean
    - `user_message` string
    - `developer_message` string
  - `data` CreateAccountScopedPAT, required
    - `id` integer, required
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required
    - `account_id` integer, required: The account the service token is associated with
    - `user_id` integer
    - `type` 1 | 2 | 3 | 4: An enumeration.
    - `uid` string, required: The unique identifier for the service token
    - `name` string, required: The name of the service token
    - `state` integer, required: The liveness state of the service token. A value of 1 means this entity is active and a value of 2 means this entity is deleted
    - `token` string: The hashed token secret
    - `token_string` string, required: The full token string used to authenticate clients
    - `expires_at` string, date-time: When the token stops authenticating. Null means it never expires.
    - `last_used` string, date-time: Deprecated.
    - `last_identify` string, date-time: Deprecated.
    - `user` object: Deprecated.
    - `service_token_permissions` object[]: Deprecated.
    - `semantic_layer_credentials` object[]: Deprecated.
    - `metadata_only` boolean: Deprecated.
    - `webhooks_only` boolean: Deprecated.
  - `extra` object
  - `error_code` integer

## Changes

- **2026-11-05** (v3) `2448b375ac2f`: 3 info
  - added the new optional request property `expires_at` (media type: application/json)
  - added the new optional request property `expires_at` (media type: application/x-www-form-urlencoded)
  - added the new optional request property `expires_at` (media type: multipart/form-data)
- **2026-10-06** (v3) `7d5c1b4c8d8a`: 2 breaking
  - for the `path` request parameter `account_id`, the format changed from no format to `int64`
  - for the `path` request parameter `user_id`, the format changed from no format to `int64`

[Operation history](https://skmtc.dev/getdbt/apis/dbt-cloud-api-v2/changes/api/v3/accounts/:account_id/users/:user_id/account-apikeys/post.md)

---

[API](https://skmtc.dev/getdbt/apis/dbt-cloud-api-v2.md) - [All operations](https://skmtc.dev/getdbt/apis/dbt-cloud-api-v2/llms.txt) - [OpenAPI document](https://skmtc.dev/getdbt/apis/dbt-cloud-api-v2/revisions/2448b375ac2f?raw)
