---
title: "Creates an organization-owned API key."
method: POST
path: "/organizations/api-keys/{id}"
tags: ["Organizations"]
---

# Creates an organization-owned API key.

`POST /organizations/api-keys/{id}`

## Request

- Base URL: `https://api.leadping.ai`
- URL: `https://api.leadping.ai/organizations/api-keys/{id}`
- Auth: HTTP bearer

The operation enforces organization ownership or platform-admin authorization and returns state suitable for membership, billing, and support workflows.

## Path parameters

- `id` string, required

## Request body

- OrganizationApiKeyRequest: Defines the display name and access configuration for a new Leadping organization API key.
  - `name` string, nullable: Human-readable name used to identify the key.
  - `expiresInDays` integer, nullable: Number of days before the key expires. Null means no expiration.
  - `permissions` string[], nullable: WorkOS permission slugs granted to the API key.

## Response `200`

The API key was created successfully.

- OrganizationApiKeyIssueResponse: Returns a newly issued organization API key and its identifying metadata; the secret credential is shown only in this response.
  - `secret` string: Secret token returned once when the Leadping API key is issued.
  - `expiresAt` string, date-time, nullable: Date and time when the organization API key issue expires.
  - `apiKey` OrganizationApiKeyPreviewResponse: Safe identifying and usage metadata for an organization API key. This model never contains the secret credential.
    - `id` string: Unique identifier of the API key.
    - `name` string: Human-readable name of the API key.
    - `organization` IdNamePair: User summary connected to this automation configuration response.
      - `id` string, required
      - `name` string, required
    - `enabled` boolean: Whether the API key can currently authenticate requests.
    - `preview` string, nullable: Masked value that can be used to identify the key without revealing its secret.
    - `permissions` string[], nullable: Permission slugs granted to the API key.
    - `issuedAt` string, date-time, nullable: Date and time when the API key was issued.
    - `firstUsedAt` string, date-time, nullable: Date and time when the API key was first used.
    - `lastUsedAt` string, date-time, nullable: Date and time when the API key was last used.
    - `expiresAt` string, date-time, nullable: Date and time when the API key expires, or null when it does not expire.
    - `totalUses` integer: Total number of tracked uses.
    - `createdAt` string, date-time: Date and time when Leadping began tracking the API key.
    - `modifiedAt` string, date-time: Date and time when the tracked API-key metadata was last modified.

## Other responses

- `400`: The request was invalid.
- `401`: Authentication credentials are missing or invalid.
- `403`: The caller cannot manage this organization API key.
- `404`: The requested resource or required account context was not found.
- `409`: The API key could not be issued because the organization state changed.
- `415`: The request content type is not supported by this endpoint.
- `429`: The client or account rate limit was exceeded. Retry after the interval in the Retry-After header.
- `500`: An unexpected error prevented the server from completing the request.

## Changes

- **2026-11-11** `81aed8c9afb7`: 4 info
  - added the non-success response with the status `404`
  - added the non-success response with the status `409`
  - added the non-success response with the status `415`
  - added the non-success response with the status `500`

[Operation history](https://skmtc.dev/leadping/apis/leadping-api/changes/organizations/api-keys/:id/post.md)

---

[API](https://skmtc.dev/leadping/apis/leadping-api.md) - [All operations](https://skmtc.dev/leadping/apis/leadping-api/llms.txt) - [OpenAPI document](https://skmtc.dev/leadping/apis/leadping-api/revisions/bf1852acaf45?raw)
