> For the complete documentation index, see [llms.txt](https://docs.chainvine.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chainvine.xyz/developers/open-api-specification.md).

# Open API Specification

## Context

Here you will find our OpenAPI specification for the Chainvine API.

### All endpoints below require you to provide your api key in the headers

```typescript
{
    'X-API-KEY': 'your-api-key'
}
```

## SyncUser

Always call this method early on in your flows to fetch a user's Chainvine ID.

Note: the SDK handles calling this endpoint for your when using the SDK to call the methods in the ChainvineUser section.

{% openapi src="/files/0aOfdewALY13Iux9G7JK" path="/api/v2/users" method="post" %}
[openapi.yaml](https://1752503732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl2v529xMI8AzUlzqr4xx%2Fuploads%2Fk7bfAvA1lkm2rdPIuBLw%2Fopenapi.yaml?alt=media\&token=c66c35b3-828c-433d-ab72-adf49d757a91)
{% endopenapi %}

This endpoint can also be used to update the user's information.

### ChainvineUser

These endpoints can also be covered via the SDK. Please see methods outlined there as needed or examples of how to use these endpoints to suit your needs.

{% openapi src="/files/px5gwdrDz7OrwYDhFiv7" path="/api/v2/user/{user\_id}/campaign/{campaign\_id}/link/referral" method="post" %}
[openapi.yaml](https://1752503732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl2v529xMI8AzUlzqr4xx%2Fuploads%2FgVVxoD02bb9t5fdNTop4%2Fopenapi.yaml?alt=media\&token=a540cdf3-d6c9-4e08-bb34-c19e5c91130f)
{% endopenapi %}

{% openapi src="/files/0aOfdewALY13Iux9G7JK" path="/api/v2/user/{user\_id}/campaign/{campaign\_id}/referral/url" method="get" %}
[openapi.yaml](https://1752503732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl2v529xMI8AzUlzqr4xx%2Fuploads%2Fk7bfAvA1lkm2rdPIuBLw%2Fopenapi.yaml?alt=media\&token=c66c35b3-828c-433d-ab72-adf49d757a91)
{% endopenapi %}

{% openapi src="/files/0aOfdewALY13Iux9G7JK" path="/api/v2/user/{user\_id}/campaign/{campaign\_id}/events/transfer" method="post" %}
[openapi.yaml](https://1752503732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl2v529xMI8AzUlzqr4xx%2Fuploads%2Fk7bfAvA1lkm2rdPIuBLw%2Fopenapi.yaml?alt=media\&token=c66c35b3-828c-433d-ab72-adf49d757a91)
{% endopenapi %}

{% openapi src="/files/0aOfdewALY13Iux9G7JK" path="/api/v2/user/{user\_id}/requirements/complete" method="post" %}
[openapi.yaml](https://1752503732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl2v529xMI8AzUlzqr4xx%2Fuploads%2Fk7bfAvA1lkm2rdPIuBLw%2Fopenapi.yaml?alt=media\&token=c66c35b3-828c-433d-ab72-adf49d757a91)
{% endopenapi %}

### V1 Endpoints

{% openapi src="/files/px5gwdrDz7OrwYDhFiv7" path="/v1/chainvine/community/{community\_id}/campaign/{campaign\_id}/record-click" method="post" %}
[openapi.yaml](https://1752503732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl2v529xMI8AzUlzqr4xx%2Fuploads%2FgVVxoD02bb9t5fdNTop4%2Fopenapi.yaml?alt=media\&token=a540cdf3-d6c9-4e08-bb34-c19e5c91130f)
{% endopenapi %}

### CodeGeneration

If you would like to generate custom code for the endpoints above, please visit our [swaggerhub page ](https://app.swaggerhub.com/apis/ChainVine/ChainVine/1.5.40)and select the "Export" drop down at the top right of the page.
