---
title: "POST /teams/{team_name}/apikeys"
method: POST
path: "/teams/{team_name}/apikeys"
tags: ["teams"]
---

# POST /teams/{team_name}/apikeys

`POST /teams/{team_name}/apikeys`

Create new team API Key.

## Path parameters

- `team_name` string, required — The unique name for the team.

## Request body

- object
  - `name` string, required — Name of the API key
  - `expires_at` string, date-time, required
  - `scope` 'read-and-write' | 'syncs-operations-only' — Scope of permissions for the API key. API keys are used for creating new plugin versions and downloading existing plugins

## Response `201`

Response

- APIKey — API Key to interact with CloudQuery Cloud under specific team
  - `name` string, required — Name of the API key
  - `created_by` string — email of the user that created the API key
  - `id` string, uuid, required — ID of the API key
  - `key` string — API key. Will be shown only in the response when creating the key.
  - `created_at` string, date-time
  - `expires_at` string, date-time, required — Timestamp at which API key will stop working
  - `last_access_at` string, date-time — Timestamp at which API key was last used - accurate to the day only.
  - `expired` boolean, required — Whether the API key has expired or not
  - `scope` 'read-and-write' | 'syncs-operations-only', required — Scope of permissions for the API key. API keys are used for creating new plugin versions and downloading existing plugins

## Other responses

- `400` — Bad request
- `401` — Requires authentication
- `403` — Forbidden
- `422` — UnprocessableEntity
- `500` — Internal Error

---

[API](https://skmtc.net/cloudquery/apis/cloudquery-openapi-spec.md) · [All operations](https://skmtc.net/cloudquery/apis/cloudquery-openapi-spec/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cloudquery/cloudquery-openapi-spec/versions/4af580f9023b/schema)
