# Get sync metrics

> The record, issue and pending change counts of a sync, per app and table: what the sync page's Statistics tab shows.

Source: https://docs.stacksync.com/api-reference/syncs/get_sync_metrics

`GET https://api.stacksync.com/v1/workspaces/{workspace_id}/bases/{base_id}/metrics`

- Operation: `get_sync_metrics`
- Resource: Syncs
- Access: read-only

## Authentication

- `Authorization: Bearer <key>`: A workspace API key (workspace_…, created by a workspace owner under Workspace settings > Stacksync API) acts with editor rights on that workspace only; a user API key (user_…, created under Profile > Stacksync API) acts as that user in every workspace they belong to. POST, PUT and PATCH requests must send Content-Type: application/json. Every authentication failure answers 403.

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `workspace_id` | integer | Yes | The workspace. List the ones your key can reach with GET /v1/workspaces. |
| `base_id` | string (uuid) | Yes | The sync. |

## Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `region` | string (besg \| usnv) | Yes | The region of the sync |

## Returns

### 200 OK

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `base_id` | string | Yes |  |
| `apps` | array of object (BaseAppMetrics) | Yes |  |
| `apps[].app_id` | string | Yes |  |
| `apps[].processing_records` | integer \| null | No |  |
| `apps[].tables` | array of object (BaseTableMetrics) | Yes |  |
| `apps[].tables[].table_mapping_id` | string | Yes |  |
| `apps[].tables[].table_name` | string | Yes |  |
| `apps[].tables[].records` | integer \| null | No |  |
| `apps[].tables[].delete_protected_records` | integer \| null | No |  |
| `apps[].tables[].issues` | integer \| null | No |  |
| `apps[].tables[].issues_created` | integer \| null | No |  |
| `apps[].tables[].issues_updated` | integer \| null | No |  |
| `apps[].tables[].issues_deleted` | integer \| null | No |  |
| `apps[].tables[].changes` | integer \| null | No |  |
| `apps[].tables[].changes_created` | integer \| null | No |  |
| `apps[].tables[].changes_updated` | integer \| null | No |  |
| `apps[].tables[].changes_deleted` | integer \| null | No |  |
| `apps[].tables[].issues_ignored` | integer \| null | No |  |
| `apps[].tables[].issues_ignored_created` | integer \| null | No |  |
| `apps[].tables[].issues_ignored_updated` | integer \| null | No |  |
| `apps[].tables[].issues_ignored_deleted` | integer \| null | No |  |

## Example request

```bash
curl -X GET "https://api.stacksync.com/v1/workspaces/{workspace_id}/bases/{base_id}/metrics?region=besg" \
  -H "Authorization: Bearer $STACKSYNC_API_KEY"
```

## Example response (200)

```json
{
  "base_id": "<base_id>",
  "apps": [
    {
      "app_id": "<app_id>",
      "processing_records": 0,
      "tables": [
        {
          "table_mapping_id": "<table_mapping_id>",
          "table_name": "<table_name>",
          "records": 0,
          "delete_protected_records": 0,
          "issues": 0,
          "issues_created": 0,
          "issues_updated": 0,
          "issues_deleted": 0,
          "changes": 0,
          "changes_created": 0,
          "changes_updated": 0,
          "changes_deleted": 0,
          "issues_ignored": 0,
          "issues_ignored_created": 0,
          "issues_ignored_updated": 0,
          "issues_ignored_deleted": 0
        }
      ]
    }
  ]
}
```

## Errors

| Status | Meaning | Body |
| --- | --- | --- |
| 400 | Bad Request | `{ "error": string, "msg": string, "field": string \| null }` |
| 403 | Forbidden | `{ "error": string, "msg": string, "field": string \| null }` |
| 404 | Not Found | `{ "error": string, "msg": string, "field": string \| null }` |

## Related

- [API Reference overview](https://docs.stacksync.com/api-reference): base URLs, regions, pagination, idempotency and errors
- [Authentication](https://docs.stacksync.com/api-reference/authentication): API keys and the 403 answers
- OpenAPI document: https://docs.stacksync.com/openapi.json
- [List syncs](https://docs.stacksync.com/api-reference/syncs/list_syncs)
- [Get a sync](https://docs.stacksync.com/api-reference/syncs/get_sync)
- [Get the status of a sync](https://docs.stacksync.com/api-reference/syncs/get_sync_status)
- [Get sync diagnostics](https://docs.stacksync.com/api-reference/syncs/get_sync_diagnostics)
- [Create a sync](https://docs.stacksync.com/api-reference/syncs/create_sync)
- [Update sync settings](https://docs.stacksync.com/api-reference/syncs/update_sync_settings)
- [Edit a sync](https://docs.stacksync.com/api-reference/syncs/edit_sync)
- [Delete a sync](https://docs.stacksync.com/api-reference/syncs/delete_sync)
- [Rename a sync](https://docs.stacksync.com/api-reference/syncs/rename_sync)
- [Switch a sync on or off](https://docs.stacksync.com/api-reference/syncs/switch_sync)
- [Set the change capture method](https://docs.stacksync.com/api-reference/syncs/set_sync_app_cdc_method)
- [Set the rate limit of an app](https://docs.stacksync.com/api-reference/syncs/set_sync_app_rate_limit)
- [Set Salesforce Bulk API access](https://docs.stacksync.com/api-reference/syncs/set_sync_app_bulk_api_access)
- [Set delete protection of an app](https://docs.stacksync.com/api-reference/syncs/set_sync_app_delete_protection)