---
title: "POST /vault/oauth/require-auth"
method: POST
path: "/vault/oauth/require-auth"
---

# POST /vault/oauth/require-auth

`POST /vault/oauth/require-auth`

## Request

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

## Request body

- object: Input for checking if a service is authenticated and getting a Connect Link if not
  - `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 check authentication for

## Response `200`

OK

- object: Authentication status and Connect Link for a service
  - `authenticated` boolean, required: Whether the service is currently authenticated
  - `connectedAccount` object, nullable, required: Connected OAuth account details
    - `id` string, required: Unique connected account identifier
    - `agentId` string, required: Agent that owns this connection
    - `userId` string, nullable, required: End-user this connection belongs to (multi-tenant)
    - `appDefinitionId` string, required: OAuth app definition ID
    - `appSlug` string, required: App slug for easy reference
    - `appName` string, required: Human-readable app name
    - `appIconUrl` string, nullable, required: App icon URL
    - `customAppId` string, nullable, required: Custom OAuth app ID (if BYOA)
    - `grantedScopes` string[], required: Scopes granted by the user
    - `accountLabel` string, nullable, required: User-defined label for this connection
    - `accountEmail` string, nullable, required: Account email from the provider
    - `status` 'PENDING' | 'ACTIVE' | 'EXPIRED' | 'REFRESHING' | 'FAILED' | 'REVOKED', required: Connection status
    - `statusMessage` string, nullable, required: Error message if status is FAILED
    - `tokenExpiresAt` string, date-time, nullable, required: When the access token expires
    - `lastRefreshedAt` string, date-time, nullable, required: When the token was last refreshed
    - `createdAt` string, date-time, required: When the connection was established
    - `updatedAt` string, date-time, required: When the connection was last updated
  - `connectLinkUrl` string, nullable, required: Connect Link URL to authenticate (if not authenticated)

---

[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)
