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

# Quickstart

> Make your first API calls in 5 minutes

This guide walks you through authenticating, listing workflows, and creating your first request via the API.

## Prerequisites

* A SimpleDocs account with API credentials (`client_id` and `client_secret`)
* At least one **published** workflow in your company
* `curl` (or any HTTP client)

## 1. Get an access token

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
curl -X POST https://app.simpledocs.com/api/oauth/token \
  -d "grant_type=client_credentials" \
  -d "client_id=YOUR_CLIENT_ID" \
  -d "client_secret=YOUR_CLIENT_SECRET" \
  -d "scope=read write"
```

Save the `access_token` from the response — you'll use it in every subsequent call.

## 2. List your workflows

Fetch the available workflows to find the one you want to create a request for:

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
curl https://app.simpledocs.com/api/v1/workflows?status=published \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
```

```json theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
{
  "data": [
    {
      "id": "k9Xp2m",
      "type": "workflow",
      "attributes": {
        "name": "Vendor Agreement",
        "description": "Standard agreement for new vendor onboarding",
        "status": "published"
      }
    }
  ],
  "pagination": {
    "current_page": 1,
    "per_page": 25,
    "total_pages": 1,
    "total_count": 1
  }
}
```

Note the workflow `id` — you'll need it in the next steps.

## 3. Get the workflow schema

Before creating a request, check which fields and variables the workflow requires:

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
curl https://app.simpledocs.com/api/v1/workflows/k9Xp2m/schema \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
```

```json theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
{
  "name": "Vendor Agreement",
  "description": "Standard agreement for new vendor onboarding",
  "required_fields": [
    "workflow_id",
    "requester_email",
    "counterparty_name",
    "counterparty_email",
    "counterparty_organization_name"
  ],
  "required_variables": ["scope_of_work"],
  "variables_properties": {
    "scope_of_work": {
      "required": true,
      "properties": {
        "type": "string",
        "suggestions": ["Cloud infrastructure services", "Marketing and branding"]
      }
    },
    "duration": {
      "required": false,
      "properties": { "type": "number" }
    },
    "duration_unit": {
      "required": false,
      "properties": { "type": "string", "options": ["year", "month"] }
    }
  }
}
```

## 4. Create a request

Now submit a request using the required fields and variables from the schema:

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
curl -X POST https://app.simpledocs.com/api/v1/requests \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -F "workflow_id=k9Xp2m" \
  -F "requester_email=jane@yourcompany.com" \
  -F "counterparty_name=John Smith" \
  -F "counterparty_email=john@acme.com" \
  -F "counterparty_organization_name=Acme Corp" \
  -F 'variables={"scope_of_work":"Cloud infrastructure services","duration":2,"duration_unit":"year"}'
```

```json theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
{
  "data": {
    "id": "mN3kYq",
    "type": "legal_request",
    "attributes": {
      "name": "Vendor Agreement — Acme Corp",
      "description": null,
      "status": "initial_review"
    }
  }
}
```

## 5. Check the request status

Poll the request to track its progress:

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
curl https://app.simpledocs.com/api/v1/requests/mN3kYq \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
```

Or view the activity log:

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
curl https://app.simpledocs.com/api/v1/requests/mN3kYq/activity \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
```

## Next steps

* **Upload documents** — See the [Repository Documents](/api-reference/repository-documents) reference.
* **Set up webhooks** — Get notified when a request is fully executed. See the [Webhooks guide](/webhooks-guide).
* **Explore the full API** — Browse all endpoints in the [API Reference](/api-reference).
