---
title: Operations
summary: >-
  Operations provide functionality to manage API operations discovered for a
  service, including listing, creating, updating, and deleting operations, as
  well as managing tags for organizing operations.
url: https://www.fastly.com/documentation/reference/api/api-security/operations
---

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `domain` | string | The domain for the operation. |
| `id` | string | The unique identifier of the discovered operation. (Read-only) |
| `last_seen_at` | string | The timestamp when the operation was last seen in traffic. (Read-only) |
| `method` | string | The HTTP method for the operation. |
| `path` | string | The path for the operation, which may include path parameters. |
| `rps` | number | Requests per second observed for this operation. (Read-only) |
| `updated_at` | string | The timestamp when the operation was last updated. (Read-only) |
| `created_at` | string | The timestamp when the operation was created. (Read-only) |
| `description` | string | A description of what the operation does. |
| `status` | string | The status of the operation. (Read-only) |
| `tag_ids` | array | An array of operation tag IDs associated with this operation. |
| `count` | integer | The number of operations associated with this operation tag. (Read-only) |
| `name` | string | The name of the operation tag. |
| `reason` | string | Error reason if the operation failed. |
| `status_code` | integer | HTTP status code for this operation. |
| `operation_ids` | array | List of operation IDs to add tags to. |
| `operations` | array | List of operations to create. |

## API endpoints

### List discovered operations

**GET** `/api-security/v1/services/{service_id}/discovered-operations`

List all discovered operations associated with a specific service. Optionally filter operations by status.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `domain` | array | query | No | Filter operations by fully-qualified domain name (exact match). |
| `limit` | integer | query | No | The maximum number of operations to return per page. |
| `method` | array | query | No | Filter operations by HTTP method. |
| `page` | integer | query | No | The page number to return. |
| `path` | string | query | No | Filter operations by path (exact match). |
| `service_id` | string | path | Yes | The unique identifier of the service. |

### List operations

**GET** `/api-security/v1/services/{service_id}/operations`

List all operations associated with a specific service. Optionally filter operations by tag ID.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `domain` | array | query | No | Filter operations by fully-qualified domain name (exact match). |
| `limit` | integer | query | No | The maximum number of operations to return per page. |
| `method` | array | query | No | Filter operations by HTTP method. |
| `page` | integer | query | No | The page number to return. |
| `path` | string | query | No | Filter operations by path (exact match). |
| `service_id` | string | path | Yes | The unique identifier of the service. |
| `status` | string | query | No | Filter operations by status. Defaults to SAVED if omitted. |
| `tag_id` | string | query | No | Filter operations by operation tag ID. Only operations associated with this operation tag will be returned. |

### Create operation

**POST** `/api-security/v1/services/{service_id}/operations`

Create a new operation associated with a specific service.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `service_id` | string | path | Yes | The unique identifier of the service. |

### Bulk create operations

**POST** `/api-security/v1/services/{service_id}/operations-bulk`

Create multiple operations associated with a specific service in a single request.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `service_id` | string | path | Yes | The unique identifier of the service. |

### Bulk delete operations

**DELETE** `/api-security/v1/services/{service_id}/operations-bulk`

Delete multiple operations in a single request.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `service_id` | string | path | Yes | The unique identifier of the service. |

### Bulk add tags to operations

**POST** `/api-security/v1/services/{service_id}/operations-bulk-tags`

Add tags to multiple operations in a single request.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `service_id` | string | path | Yes | The unique identifier of the service. |

### Retrieve operation

**GET** `/api-security/v1/services/{service_id}/operations/{operation_id}`

Get a specific operation associated with a service.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `operation_id` | string | path | Yes | The unique identifier of the operation. |
| `service_id` | string | path | Yes | The unique identifier of the service. |

### Delete operation

**DELETE** `/api-security/v1/services/{service_id}/operations/{operation_id}`

Delete an existing operation associated with a specific service.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `operation_id` | string | path | Yes | The unique identifier of the operation. |
| `service_id` | string | path | Yes | The unique identifier of the service. |

### Update operation

**PATCH** `/api-security/v1/services/{service_id}/operations/{operation_id}`

Partially update an existing operation associated with a specific service.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `operation_id` | string | path | Yes | The unique identifier of the operation. |
| `service_id` | string | path | Yes | The unique identifier of the service. |

### List operation tags

**GET** `/api-security/v1/services/{service_id}/tags`

List all operation tags associated with a specific service.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `limit` | integer | query | No | The maximum number of operations to return per page. |
| `page` | integer | query | No | The page number to return. |
| `service_id` | string | path | Yes | The unique identifier of the service. |

### Create operation tag

**POST** `/api-security/v1/services/{service_id}/tags`

Create a new operation tag associated with a specific service.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `service_id` | string | path | Yes | The unique identifier of the service. |

### Retrieve operation tag

**GET** `/api-security/v1/services/{service_id}/tags/{tag_id}`

Get a specific operation tag by its unique identifier.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `service_id` | string | path | Yes | The unique identifier of the service. |
| `tag_id` | string | path | Yes | The unique identifier of the operation tag. |

### Delete operation tag

**DELETE** `/api-security/v1/services/{service_id}/tags/{tag_id}`

Delete an existing operation tag.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `service_id` | string | path | Yes | The unique identifier of the service. |
| `tag_id` | string | path | Yes | The unique identifier of the operation tag. |

### Update operation tag

**PATCH** `/api-security/v1/services/{service_id}/tags/{tag_id}`

Partially update an existing operation tag.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `service_id` | string | path | Yes | The unique identifier of the service. |
| `tag_id` | string | path | Yes | The unique identifier of the operation tag. |
