---
search:
  tags:
    - Actions
    - POST
seo:
  description: >-
    Answers 404 where the mcp-upstreams feature is off. Held by the… Reference
    for the POST /api/v2/mcp-upstreams/{id}/connect-links endpoint in the Anlyon
    API.
sidebar:
  label: Create a connect link for an end user to an OAuth upstream
  badge: POST
title: Create a connect link for an end user to an OAuth upstream
type: openapi-operation
---
Answers 404 where the `mcp-upstreams` feature is off. Held by the developer's server: the key needs `end-users:write`, which is not in the default set, and the end user consents themselves. A link one end user opens to sign in to an OAuth upstream (ADR 0026) with their own account: the same consent, confirmation and limits as an integration's connect link. Their grant is used only for calls made for them.

`POST /api/v2/mcp-upstreams/{id}/connect-links`

**Request body** (`application/json`, required)

- `endUserId` (string, required)
- `redirectUrl` (string<uri> | null)

Request body example:

```json
{
  "endUserId": "string",
  "redirectUrl": "http://example.com"
}
```

**Responses**

- `201` — The link.
- `400` — Bad Request - Invalid input data
- `401` — Unauthorized - Invalid or missing API key
- `403` — Authenticated credential lacks the required scope or workspace access.
- `404` — Not Found - Resource does not exist
- `429` — Too Many Requests - Rate limit exceeded. A workspace's API requests are limited per minute and per UTC clock hour by plan; \`Retry-After\` says when to try again, and an hourly refusal names the limit and when the count resets. Successful responses carry the same limits in \`X-RateLimit-Limit\`, \`X-RateLimit-Remaining\`, \`X-RateLimit-Reset\` (the minute) and \`X-RateLimit-Limit-Hour\`, \`X-RateLimit-Remaining-Hour\`, \`X-RateLimit-Reset-Hour\` (the hour).

Response example, 201:

```json
{
  "success": true,
  "data": {
    "url": "http://example.com",
    "expiresAt": "2019-08-24T14:15:22Z"
  }
}
```

Response example, 400:

```json
{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid request data",
    "details": {
      "url": "Invalid URL format"
    }
  }
}
```

Response example, 401:

```json
{
  "success": false,
  "error": {
    "code": "AUTHENTICATION_ERROR",
    "message": "Invalid or missing API key"
  }
}
```

Response example, 404:

```json
{
  "success": false,
  "error": {
    "code": "NOT_FOUND",
    "message": "Resource not found"
  }
}
```

Response example, 429:

```json
{
  "success": false,
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "Rate limit exceeded. Please try again later."
  }
}
```
