> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dittofeed.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Using Dittofeed's REST API as a source

> Send data directly to Dittofeed's segment compatible API.

Workspace members can send data directly to Dittofeed's segment compatible API. This is useful if you want to circumvent an external source integration, like Dittofeed's [segment integration](/integrations/sources/segment).

This source of Dittofeed events is especially useful when self-hosting, as it allows you to send user data to Dittofeed without it ever being sent to a third party server.

## Endpoints

Dittofeed's API is compatible with [segment's API](https://segment.com/docs/connections/sources/catalog/libraries/server/http-api/).

* [`/api/public/apps/identify`](/api-reference/endpoints/apps/identify)
* [`/api/public/apps/track`](/api-reference/endpoints/apps/track)
* [`/api/public/apps/page`](/api-reference/endpoints/apps/page)
* [`/api/public/apps/screen`](/api-reference/endpoints/apps/screen)

## Authentication

Dittofeed's API uses Write Keys to authenticate requests. You can find your Write Key in your workspace settings [`/dashboard/settings#settings#write-key-title`](https://app.dittofeed.com/dashboard/settings#settings#write-key-title).

Include write keys as an HTTP `Authorization: Basic ...` header in your requests. It's safe to include this write key in your
client (e.g. your web client javascript payload).

For example, you can use the following to submit an identify request to our demo workspace:

```bash theme={null}
curl -H 'Content-Type:application/json' \
     -H 'Authorization:Basic Y2M4MzBjOTItYTI5Mi00NjczLWI0ODUtY2E2YzNiNTkzOGNmOjQzN2ViMjFiNDQzZTQxNDY=' \
     -X POST \
     -d '{
         "userId": "'$(uuidgen)'",
         "messageId": "'$(uuidgen)'",
         "traits": {
             "email": "fake@email.com"
         }
     }' \
    https://demo.dittofeed.com/api/public/apps/identify
```

## SDK's

Dittofeed's API's can be conveniently accessed with platform specific [SDK's](/integrations/sdks).

<Snippet file="available-sdks.mdx" />
