---
title: "POST /vault/oauth/link"
method: POST
path: "/vault/oauth/link"
---

# POST /vault/oauth/link

`POST /vault/oauth/link`

## Request

- Base URL: `https://api.useanima.sh/v1`
- URL: `https://api.useanima.sh/v1/vault/oauth/link`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

## Request body

- object: Input for creating a Connect Link — a hosted auth URL
  - `agentId` union: Agent identifier. Optional when using an agent API key (resolved automatically); required when using a master key.
    - string
    - string
  - `userId` string: End-user ID for multi-tenant scoping
  - `appSlug` string, required: App slug to create a link for (e.g. google, github)
  - `scopes` string[]: Override default scopes
  - `callbackUrl` string, uri: URL to redirect to after auth completes
  - `customAppId` string: Use a custom OAuth app (BYOA)

## Response `200`

OK

- object: Created Connect Link for zero-code authentication
  - `linkUrl` string, required: Full Connect Link URL for the user to open
  - `token` string, required: Link token for status polling
  - `expiresAt` string, date-time, required: When the link expires (10 minutes)

---

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