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

# Raven Slingshot

> Connect to Raven Slingshot to pull machine file data through Leaf's provider credentials API using API key authentication.

Leaf connects to Raven Slingshot using API key credentials. Once connected, Leaf ingests machine files from Slingshot for the Leaf user.

This is separate from [Raven](/providers/raven), which uses OAuth 2.0 credentials for grower, farm, and field data.

## Prerequisites

1. A Raven Slingshot portal account.
2. Your `apiKey`, `accessKey`, and `sharedSecret` from the Slingshot portal.

## Credentials schema

| Field          | Type   | Required | Description                   |
| -------------- | ------ | -------- | ----------------------------- |
| `apiKey`       | string | Yes      | Your Slingshot API key.       |
| `accessKey`    | string | Yes      | Your Slingshot access key.    |
| `sharedSecret` | string | Yes      | Your Slingshot shared secret. |

## Endpoints

| Method | Path                                                     | Description                                |
| ------ | -------------------------------------------------------- | ------------------------------------------ |
| GET    | `/users/{leafUserId}/raven-slingshot-credentials`        | Get stored credentials.                    |
| POST   | `/users/{leafUserId}/raven-slingshot-credentials`        | Create credentials.                        |
| DELETE | `/users/{leafUserId}/raven-slingshot-credentials`        | Delete credentials.                        |
| GET    | `/users/{leafUserId}/raven-slingshot-credentials/events` | Get credential events for troubleshooting. |

Base URL: `https://api.withleaf.io/services/usermanagement/api`

### Create credentials

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -H 'Content-Type: application/json' \
    -d '{
      "apiKey": "your-api-key",
      "accessKey": "your-access-key",
      "sharedSecret": "your-shared-secret"
    }' \
    'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/raven-slingshot-credentials'
  ```

  ```python Python theme={null}
  import requests

  TOKEN = "YOUR_TOKEN"
  endpoint = "https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/raven-slingshot-credentials"
  headers = {"Authorization": f"Bearer {TOKEN}"}

  payload = {
      "apiKey": "your-api-key",
      "accessKey": "your-access-key",
      "sharedSecret": "your-shared-secret",
  }

  response = requests.post(endpoint, headers=headers, json=payload)
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const axios = require("axios");

  const TOKEN = "YOUR_TOKEN";
  const endpoint = "https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/raven-slingshot-credentials";
  const headers = { Authorization: `Bearer ${TOKEN}` };

  const payload = {
    apiKey: "your-api-key",
    accessKey: "your-access-key",
    sharedSecret: "your-shared-secret",
  };

  axios.post(endpoint, payload, { headers })
    .then((res) => console.log(res.data))
    .catch(console.error);
  ```
</CodeGroup>

### Response

```json theme={null}
{
  "id": "uuid",
  "status": "str",
  "createdTime": "2026-01-15T12:00:00.000000Z",
  "apiKey": "your-api-key",
  "accessKey": "your-access-key"
}
```

## Troubleshooting

Use the events endpoint to check credential health. Events are retained for 30 days and are deleted when the credential is removed.

```
GET /users/{leafUserId}/raven-slingshot-credentials/events
```

## What to do next

* [Raven](/providers/raven) for OAuth-based grower, farm, and field data.
* [API Reference: Providers](/api-reference/providers) for the full credential path matrix.
