---
title: "Create auth config."
method: POST
path: "/api_auth_configs"
tags: ["Org authentication configs"]
---

# Create auth config.

`POST /api_auth_configs`

## Request

- Base URL: `https://dataops.nexla.io/nexla-api`
- URL: `https://dataops.nexla.io/nexla-api/api_auth_configs`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/nexla/apis/nexla-rest-api/docs/api_auth_configs/post.ts> (a function with typed inputs; its response is checked against the schema)

Create a new authentication configuration for the API.

## Request body

- AuthConfigPayload
  - `id` integer
  - `owner_id` integer
  - `org_id` integer
  - `uid` string
  - `protocol` string
  - `name` string
  - `description` string
  - `global` boolean
  - `enabled_by_default` boolean
  - `auto_create_users_enabled` boolean
  - `name_identifier_format` string
  - `nexla_base_url` string
  - `service_entity_id` string
  - `assertion_consumer_url` string
  - `idp_entity_id` string
  - `idp_sso_target_url` string
  - `idp_slo_target_url` string
  - `idp_cert` string
  - `security_settings` object
  - `metadata` string
  - `oidc_domain` string
  - `oidc_keys_url_key` string
  - `oidc_id_claims` object
  - `oidc_access_claims` object
  - `client_config` object
  - `secret_config` object
  - `check_state` boolean

## Response `200`

Success

- AuthConfig
  - `id` integer
  - `owner` UserSimplified
    - `id` integer
    - `full_name` string
    - `email` string
    - `email_verified_at` string, date-time
  - `org` OrgSimplified
    - `id` integer
    - `name` string
    - `email_domain` string
    - `email` string
    - `client_identifier` string
    - `org_webhook_host` string
  - `uid` string: Unique external identifier for the authentication configuration.
  - `protocol` 'saml' | 'oidc' | 'google' | 'password'
  - `name` string
  - `description` string
  - `global` boolean: If true, this configuration is available to all organizations in the environment.
  - `auto_create_users_enabled` boolean: If true, Nexla will automatically create users in the environment when they log in using this authentication configuration.
  - `name_identifier_format` string: The format of the NameID element in the SAML assertion. This is used to identify the user.
  - `nexla_base_url` string: The base URL of the Nexla environment where the user should be redirected after authentication.
  - `service_entity_id` string
  - `assertion_consumer_url` string
  - `logout_url` string
  - `metadata_url` string
  - `idp_entity_id` string
  - `idp_sso_target_url` string
  - `idp_slo_target_url` string
  - `idp_cert` string
  - `security_settings` string
  - `oidc_domain` string
  - `oidc_keys_url_key` string
  - `oidc_token_verify_url` string
  - `oidc_id_claims` string
  - `oidc_access_claims` string
  - `client_config` object
  - `updated_at` string, date-time
  - `created_at` string, date-time

## Other responses

- `400`: Bad Request
- `403`: Forbidden

---

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