# API Requests

## Authentication

All API requests are authenticated using Auth 2.0, managed securely through GovTribe's integration with Zapier.

## Required Headers

Every request made through Zapier will include these headers automatically:

```
Authorization: Bearer YOUR_ACCESS_TOKEN
Content-Type: application/json
Accept: application/json
```

## Auth Test

Request

```
POST /api/zapier/auth-test
```

Response

```
200 OK
```

Returns a JSON object containing the authenticated user's ID, name, and email address.

### Federal Contract Opportunity - List

Returns a list of [Federal Contract Opportunity Resources](#federal-contract-opportunity-resource). Provide an optional `saved_search_model_id` to filter the results.

**Request**

**GET** `/api/zapier/federal-contract-opportunity`

```json
{
    "saved_search_model_id": "66f55bc64b8b9d6b840396e8"
}
```

**Response**

**200 OK**

```json
[
  {
    "id": "c119c6fc-5ce3-4fc6-bf5d-0c8d63bd7015",
    "name": "Federal Contract Opportunity 1",
    // Additional fields...
  },
  // More opportunities...
]
```

### Federal Contract Opportunity - Get

Returns a single hydrated [Federal Contract Opportunity Resources](#federal-contract-opportunity-resource).

**Request**

**GET** `/api/zapier/federal-contract-opportunity/{id}`

**Response**

**200 OK**

```json
{
    "id": "c119c6fc-5ce3-4fc6-bf5d-0c8d63bd7015",
    "name": "Federal Contract Opportunity 1",
    // Additional fields...
}
```

### Federal Contract Award - List

Returns a list of [Federal Contract Award Resource](#federal-contract-award-resource). Provide an optional `saved_search_model_id` to filter the results.

**Request**

**GET** `/api/zapier/federal-contract-award`

```json
{
    "saved_search_model_id": "66f55bc64b8b9d6b840396e8"
}
```

**Response**

**200 OK**

```json
[
  {
    "id": "c119c6fc-5ce3-4fc6-bf5d-0c8d63bd7015",
    "name": "Federal Contract Award 1",
    // Additional fields...
  },
  // More opportunities...
]
```

### Federal Contract Award- Get

Returns a single hydrated [Federal Contract Award Resource](#federal-contract-award-resource).

**Request**

**GET** `/api/zapier/federal-contract-award/{id}`

**Response**

**200 OK**

```json
{
    "id": "c119c6fc-5ce3-4fc6-bf5d-0c8d63bd7015",
    "name": "Federal Contract Award 1",
    // Additional fields...
}
```

### Federal Contract IDV - List

Returns a list of [Federal Contract IDV Resources](https://docs.govtribe.com/user-guide/integrations/zapier#federal-contract-idv-resource). Provide an optional `saved_search_model_id` to filter the results.

**Request**

**GET** `/api/zapier/federal-contract-idv`

```
{
    "saved_search_model_id": "67902c7d7038e143aa085322"
}
```

**Response**

**200 OK**

```json
[
  {
    "id": "c119c6fc-5ce3-4fc6-bf5d-0c8d63bd7015",
    "name": "Federal Contract IDV 1",
    // Additional fields...
  },
  // More contract IDVs...
]
```

### Federal Contract IDV - Get

Returns a single hydrated [Federal Contract IDV Resource](#federal-contract-idv-resource).

**Request**

**GET** `/api/zapier/federal-contract-idv/{id}`

**`Response`**

**`200 OK`**

```json
{
  "id": "c119c6fc-5ce3-4fc6-bf5d-0c8d63bd7015",
  "name": "Federal Contract IDV 1",
  // Additional fields... 
}
```

### Federal Grant Opportunity - List

Returns a single hydrated [Federal Grant Opportunity Resources](#federal-grant-opportunity-resource). Provide an optional `saved_search_model_id` to filter the results.

**Request**

**GET** `/api/zapier/federal-grant-opportunity`

```json
{
    "saved_search_model_id": "66f55bc64b8b9d6b840396e8"
}
```

**Response**

**200 OK**

```json
[
  {
    "id": "345209-F",
    "name": "Federal Grant Opportunity 1",
    // Additional fields...
  },
  // More opportunities...
]
```

### Federal Grant Opportunity - Get

Returns a single hydrated [Federal Grant Opportunity](#federal-grant-opportunity-resource).

**Request**

**GET** `/api/zapier/federal-grant-opportunity/{id}`

**Response**

**200 OK**

```json
{
    "id": "345209-F",
    "name": "Federal Grant Opportunity 1",
    // Additional fields...
}
```

### Federal Grant Award - List

Returns a list of [Federal Grant Award Resources](https://docs.govtribe.com/user-guide/integrations/zapier#federal-grant-award-resource). Provide an optional `saved_search_model_id` to filter the results.

**Request**

**GET** `/api/zapier/federal-grant-award`&#x20;

```json
{
    "saved_search_model_id": "66f55bc64b8b9d6b840396e8"
}
```

**Response**

**200 OK**

```json
[
  {
    "id": "AIDFFPG1100062",
    "name": "Federal Grant Award 1",
    // Additional fields...
  }
  // More opportunities...
}
```

**Federal Grant Award - Get**

Returns a single hydrated [Federal Grant Award Resource](https://docs.govtribe.com/user-guide/integrations/zapier#federal-grant-award-resource).

**Request**

**GET** `/api/zapier/federal-grant-award/{id}`

**Response**

**200 OK**

```json
{
    "id": "AIDFFPG1100062",
    "name": "Federal Grant Award 1",
    // Additional fields...
{
```

### Federal Forecast - List

Returns a list of [Federal Forecast Resources](https://docs.govtribe.com/user-guide/integrations/zapier#federal-forecast-resource-1). Provide an optional `saved_search_model_id` to filter the list.

**Request**

**GET** `/api/zapier/federal-forecast`

```json
{
    "saved_search_model_id": "65778750fc0f437422012b12"
}
```

**Response**

**200 OK**

```json
[
  {
    "id": "65778750fc0f437422012b12",
    "name": "Federal Forecast 1",
    // Additional fields...
  },
  // More forecasts...
]
```

### Federal Forecast - Get

Returns a single hydrated [Federal Forecast Resource.](https://docs.govtribe.com/user-guide/integrations/zapier#federal-forecast-resource-1)

**Request**

**GET** `/api/zapier/federal-forecast/{id}`

**Response**

**200 OK**

```json
{
    "id": "65778750fc0f437422012b12",
    "name": "Federal Forecast 1"
    // Additional fields...
}
```

### State and Local Contract Opportunity - List

Returns a list of [State and Local Contract Opportunity Resources](#state-and-local-contract-opportunity-resource). Provide an optional `saved_search_model_id` to filter the results.

**Request**

**GET** `/api/zapier/state-local-contract-opportunity`

```json
{
    "saved_search_model_id": "66f55bc64b8b9d6b840396e8"
}
```

**Response**

**200 OK**

```json
[
  {
    "id": "65f49c390c6a1c87ae063840",
    "name": "Media Monitoring Suite ( Public Info)",
    // Additional fields...
  },
  // More opportunities...
]
```

### State and Local Contract Opportunity - Get

Returns a single hydrated [State and Local Contract Opportunity Resource](#state-and-local-contract-opportunity-resource).

**Request**

**GET** `/api/zapier/state-local-contract-opportunity/{id}`

**Response**

**200 OK**

```json
{
    "id": "65f49c390c6a1c87ae063840",
    "name": "Media Monitoring Suite ( Public Info)",
    // Additional fields...
}
```

### Pipeline - List

Returns a list of [Pipeline Resources](#pipeline-resource) the user has access to.

**Request**

**GET** `/api/zapier/pipeline`

**Response**

**200 OK**

```json
[
  {
    "id": "66f70adf61275a2069065f63",
    "name": "Pipeline 1",
    // Additional fields...
  },
  // More opportunities...
]
```

### Pipeline - Get

Returns a single hydrated [Pipeline Resource](#pipeline-resource).

**Request**

**GET** `/api/zapier/pipeline/{id}`

**Response**

**200 OK**

```json
{
    "id": "66f70adf61275a2069065f63",
    "name": "Pipeline 1",
    // Additional fields...
}
```

### Stage - List

Returns a list of [Stage Resources](#stage-resource) the user has access to.

**Request**

**GET** `/api/zapier/stage`

**Response**

**200 OK**

```json
[
  {
    "id": "66f70bba3b1a2d4e09061a36",
    "name": "Won",
    // Additional fields...
  },
  // More opportunities...
]
```

### Stage - Get

Returns a single hydrated [Stage Resource](#stage-resource).

**Request**

**GET** `/api/zapier/stage/{id}`

**Response**

**200 OK**

```json
{
    "id": "66f70bba3b1a2d4e09061a36",
    "name": "Won",
    // Additional fields...
}
```

### Pursuit - List

Returns a list of [Pursuit Resources](#pursuit-resource) the user has access to.

**Request**

**GET** `/api/zapier/pursuit`

**Response**

**200 OK**

```json
[
  {
    "id": "66f70b7665db93f2b90ab6e7",
    "name": "Pursuit",
    // Additional fields...
  },
  // More opportunities...
]
```

### Pursuit - Get

Returns a single hydrated [Pursuit Resource](#pursuit-resource).

**Request**

**GET** `/api/zapier/pursuit/{id}`

**Response**

**200 OK**

```json
{
    "id": "66f70b7665db93f2b90ab6e7",
    "name": "Pursuit",
    // Additional fields...
}
```
