---
title: "Create a secret"
method: POST
path: "/integration_secrets"
tags: ["Integration Secrets"]
---

# Create a secret

`POST /integration_secrets`

Create a new secret with an associated identifier that can be used to securely integrate with other services.

## Request body

- CreateIntegrationSecretRequest
  - `identifier` string, required — The unique identifier of the secret.
  - `type` 'bearer' | 'basic', required — The type of secret.
  - `token` string — The token for the secret. Required for bearer type secrets, ignored otherwise.
  - `username` string — The username for the secret. Required for basic type secrets, ignored otherwise.
  - `password` string — The password for the secret. Required for basic type secrets, ignored otherwise.

## Response `201`

Successful Response

- IntegrationSecretCreatedResponse
  - `data` IntegrationSecret, required
    - `record_type` string, required
    - `id` string, required
    - `identifier` string, required
    - `created_at` string, date-time, required
    - `updated_at` string, date-time

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/team-telnyx/apis/telnyx-api.md) · [All operations](https://skmtc.net/team-telnyx/apis/telnyx-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/team-telnyx/telnyx-api/revisions/e32d46c5945b/schema)
