# Getting started

## Base URL

```
https://prolinks.pro/api/v1
```

## Authentication

The API uses the same API tokens as the [MCP server](/docs/mcp). To create a token, follow the steps in [Getting started with MCP](/docs/mcp/getting-started#2-create-an-api-token).

Send the token in the `Authorization` header of every request. Also send `Accept: application/json`, so that errors come back as JSON.

```bash
curl https://prolinks.pro/api/v1/organizations \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json"
```

## Organization ID

Most endpoints need an `organization_id` parameter. Get the IDs of your organizations from `GET /organizations`.

Unlike the MCP server, the REST API does not choose an organization for you.

## Create a link

1. Get the ID of a domain from `GET /domains?organization_id=YOUR_ORGANIZATION_ID`.
2. Send a `POST` request to `/links`:

```bash
curl -X POST https://prolinks.pro/api/v1/links \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "organization_id": 1,
    "domain_id": 1,
    "url": "https://example.com/pricing",
    "slug": "pricing",
    "campaign_name": "spring-sale"
  }'
```

The API returns the new link with status `201 Created`.

## Limits

Every request with an `organization_id` counts against the per-minute API request limit of that organization. The REST API and the MCP server share the same limit. When you reach the limit, the API returns `429 Too Many Requests` with a `Retry-After` header. Read [Limits and errors](/docs/mcp/limits-and-errors).

## Next steps

Open the [REST API reference](/docs/api) for every endpoint and its parameters.
