> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://documents.pyramid-ai.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://documents.pyramid-ai.com/_mcp/server.

# Create a compliance check run

POST https://api.pyramid-ai.com/api/v2/check/runs
Content-Type: application/json

Creates an analysis run with multiple requirements. Call
POST /check/runs/\{id}/trigger to start processing.

Reference: https://documents.pyramid-ai.com/api-reference/api-explorer/check/create-check-run

## Authentication

- `Authorization` header (bearer token, required) — Pyramid API key (prefix with "Bearer ")

## Servers

- `https://api.pyramid-ai.com` (Production, default)
- `https://api-staging.pyramid-ai.com` (Staging (sandbox) — use pai_test_* keys)

## Request

### Body (application/json)

This endpoint expects an object.

- `project_id` (string, required)
- `name` (string, required)
- `requirements` (list of ApiV2CheckRunsPostRequestBodyContentApplicationJsonSchemaRequirementsItems, required)
- `handbook_ids` (list of string, optional)

## Response

### 201

Check run created

- `request_id` (string, required) — Server-generated per-request UUID. Also sent as `X-Request-Id` response header. Include in support tickets.
- `success` (any, required)
- `data` (CheckRunSummary, optional)
- `pagination` (Pagination, optional) — Present only on list endpoints. Top-level (not nested inside `data`).

## Errors

### 400 Bad Request Error

Validation error

- `success` (any, required)
- `error` (ApiErrorError, required)
- `request_id` (string, required)

### 401 Unauthorized Error

Unauthorized

- `success` (any, required)
- `error` (ApiErrorError, required)
- `request_id` (string, required)

### 404 Not Found Error

Project not found or access denied

- `success` (any, required)
- `error` (ApiErrorError, required)
- `request_id` (string, required)

## Types

### ApiV2CheckRunsPostRequestBodyContentApplicationJsonSchemaRequirementsItems

- `text` (string, required)
- `metadata` (ApiV2CheckRunsPostRequestBodyContentApplicationJsonSchemaRequirementsItemsMetadata, optional)

### CheckRunSummary

- `id` (string, required)
- `name` (string, required)
- `org_id` (string, required) — Stable org identifier. Not email or slug.
- `project_id` (string, required)
- `status` (enum, required)
  - Allowed values: `pending`, `processing`, `completed`, `stopped`, `failed`
- `total_requirements` (integer, required)
- `created_at` (datetime, required)
- `updated_at` (datetime, required)
- `description` (string, optional, nullable)
- `project_name` (string, optional, nullable)
- `processed_requirements` (integer, optional)
- `passed_requirements` (integer, optional)
- `failed_requirements` (integer, optional)
- `processing_started_at` (datetime, optional, nullable)
- `processing_completed_at` (datetime, optional, nullable)

### Pagination

Offset-based pagination for list endpoints. Clients compute `has_more` from `offset + data.length < total`. Cursor pagination may be added per-endpoint later if deep-pagination performance becomes a concern.

- `total` (integer, required) — Total item count matching the filters (ignoring limit/offset).
- `offset` (integer, required)
- `limit` (integer, required, default: 50)

### ApiErrorError

- `code` (enum, required)
  - Allowed values: `VALIDATION_ERROR`, `UNAUTHORIZED`, `FORBIDDEN`, `FEATURE_NOT_ENABLED`, `AGENT_NOT_ENABLED`, `QUOTA_EXCEEDED`, `NOT_FOUND`, `CONFLICT`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `UPLOAD_NOT_FOUND`, `UPLOAD_SIZE_MISMATCH`, `RATE_LIMITED`, `INTERNAL_ERROR`
- `message` (string, required) — Human-readable description. May be shown to end users; keep stable across minor changes.
- `docs_url` (string, optional) — Link to the error's documentation section.
- `field` (string, optional) — Only for `VALIDATION_ERROR`. JSONPath-ish reference to the offending field (e.g. `body.project_id`).
- `feature` (string, optional) — Only for `FEATURE_NOT_ENABLED`. The feature key the request required.

### ApiV2CheckRunsPostRequestBodyContentApplicationJsonSchemaRequirementsItemsMetadata

## Examples

**Request**

```json
{
  "project_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "name": "Q4 Safety Audit",
  "requirements": [
    {
      "text": "Verify that all fire extinguishers are inspected and tagged according to the latest safety standards."
    },
    {
      "text": "Ensure emergency exit routes are clearly marked and unobstructed."
    }
  ]
}
```

**Response**

```json
{
  "request_id": "req_9f8b7c6d-1234-4e56-8a9b-0c1d2e3f4a5b",
  "success": true,
  "data": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "name": "Q4 Safety Audit",
    "org_id": "org_ais",
    "project_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "status": "pending",
    "total_requirements": 2,
    "created_at": "2024-09-25T14:45:00Z",
    "updated_at": "2024-09-25T14:45:00Z",
    "description": "Quarterly audit checking all fire safety requirements against project documentation",
    "project_name": "Corporate Headquarters Renovation",
    "processed_requirements": 0,
    "passed_requirements": 0,
    "failed_requirements": 0,
    "processing_started_at": "2024-10-01T08:00:00Z",
    "processing_completed_at": "2024-10-01T08:00:00Z"
  },
  "pagination": {
    "total": 127,
    "offset": 0,
    "limit": 50
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.pyramid-ai.com/api/v2/check/runs"

payload = {
    "project_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "name": "Q4 Safety Audit",
    "requirements": [{ "text": "Verify that all fire extinguishers are inspected and tagged according to the latest safety standards." }, { "text": "Ensure emergency exit routes are clearly marked and unobstructed." }]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.pyramid-ai.com/api/v2/check/runs';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"project_id":"3fa85f64-5717-4562-b3fc-2c963f66afa6","name":"Q4 Safety Audit","requirements":[{"text":"Verify that all fire extinguishers are inspected and tagged according to the latest safety standards."},{"text":"Ensure emergency exit routes are clearly marked and unobstructed."}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.pyramid-ai.com/api/v2/check/runs"

	payload := strings.NewReader("{\n  \"project_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n  \"name\": \"Q4 Safety Audit\",\n  \"requirements\": [\n    {\n      \"text\": \"Verify that all fire extinguishers are inspected and tagged according to the latest safety standards.\"\n    },\n    {\n      \"text\": \"Ensure emergency exit routes are clearly marked and unobstructed.\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.pyramid-ai.com/api/v2/check/runs")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"project_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n  \"name\": \"Q4 Safety Audit\",\n  \"requirements\": [\n    {\n      \"text\": \"Verify that all fire extinguishers are inspected and tagged according to the latest safety standards.\"\n    },\n    {\n      \"text\": \"Ensure emergency exit routes are clearly marked and unobstructed.\"\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.pyramid-ai.com/api/v2/check/runs")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"project_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n  \"name\": \"Q4 Safety Audit\",\n  \"requirements\": [\n    {\n      \"text\": \"Verify that all fire extinguishers are inspected and tagged according to the latest safety standards.\"\n    },\n    {\n      \"text\": \"Ensure emergency exit routes are clearly marked and unobstructed.\"\n    }\n  ]\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.pyramid-ai.com/api/v2/check/runs', [
  'body' => '{
  "project_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "name": "Q4 Safety Audit",
  "requirements": [
    {
      "text": "Verify that all fire extinguishers are inspected and tagged according to the latest safety standards."
    },
    {
      "text": "Ensure emergency exit routes are clearly marked and unobstructed."
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.pyramid-ai.com/api/v2/check/runs");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"project_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n  \"name\": \"Q4 Safety Audit\",\n  \"requirements\": [\n    {\n      \"text\": \"Verify that all fire extinguishers are inspected and tagged according to the latest safety standards.\"\n    },\n    {\n      \"text\": \"Ensure emergency exit routes are clearly marked and unobstructed.\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "project_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "name": "Q4 Safety Audit",
  "requirements": [["text": "Verify that all fire extinguishers are inspected and tagged according to the latest safety standards."], ["text": "Ensure emergency exit routes are clearly marked and unobstructed."]]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.pyramid-ai.com/api/v2/check/runs")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```