---
title: "Create an identity connection"
method: POST
path: "/v1/teams/{teamId}/identity-connections"
tags: ["Teams"]
---

# Create an identity connection

`POST /v1/teams/{teamId}/identity-connections`

## Request

- Base URL: `https://api.spacefast.com`
- URL: `https://api.spacefast.com/v1/teams/{teamId}/identity-connections`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://api.spacefast.com/v1/auth/oauth2/authorize`, token URL `https://api.spacefast.com/v1/auth/oauth2/token`; client credentials, token URL `https://api.spacefast.com/v1/auth/oauth2/token`, scopes: `teams:create`)

Connects an outside sign-in system to the team so Grants can admit its people to the team's Spaces: an OIDC provider (`type: oidc` with issuer, client ID, and client secret) or the team's own signer (`type: signer` with issuer, authorize URL, and public keys). The client secret is stored write-only; responses report only `clientSecretSet`. The connection admits no one by itself; only Grants that name it do. It changes who can sign in, so create one only at the user's request.

## Path parameters

- `teamId` string, required

## Request body

- union
  - object
    - `type` 'oidc', required
    - `name` string, required
    - `issuer` string, required
    - `clientId` string, required
    - `clientSecret` string, required
    - `sessionTtlSeconds` integer
  - object
    - `type` 'signer', required
    - `name` string, required
    - `issuer` string, required
    - `authorizeUrl` string, required
    - `publicKeys` object[], required
      - `kid` string, required
      - `publicKey` string, required
    - `sessionTtlSeconds` integer

## Response `201`

Response for status 201

- object
  - `$schema` string, uri: Canonical JSON Schema URL for this response body. The server also sends it in the `Link: rel="describedby"` response header.
  - `data` object, required
    - `id` string, required
    - `teamId` string, required
    - `type` 'oidc' | 'signer', required
    - `name` string, required
    - `issuer` string, required
    - `clientId` string, nullable, required
    - `clientSecretSet` boolean, required
    - `authorizeUrl` string, nullable, required
    - `publicKeys` object[], required
      - `kid` string, required
      - `publicKey` string, required
    - `sessionTtlSeconds` integer, required
    - `createdAt` string, date-time, required
    - `rotatedAt` string, date-time, nullable, required
    - `lastUsedAt` string, date-time, nullable, required
    - `revokedAt` string, date-time, nullable, required

## Other responses

- `default`: Problem details (RFC 9457). Any 4xx/5xx response is one `application/problem+json` document.

---

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