# Create operations activity export

Source: https://business-api-docs.youhodler.com/docs/api/reference/operations-activity-exports/operations-activity-exports-create

## Request

**Request URL — POST**
```http
POST /operations-activity-exports
```

**Request Body — application/json**
```json
{
  "format": "csv",
  "filter_criteria": {
    "date_from_utc": "2026-04-01T00:00:00Z",
    "date_to_utc": "2026-04-30T23:59:59Z"
  },
  "requested_scope": {
    "kind": "enterprise",
    "ref": "enterprises/b8e2f1a0-4c3d-4e5f-9a1b-2c3d4e5f6a7b"
  }
}
```

## Responses

**201 Resource created successfully**

Resource created successfully.

```json
{
  "format": "csv",
  "byte_size": 32768,
  "download_path": "/operations-activity-exports/b8e2f1a0-4c3d-4e5f-9a1b-2c3d4e5f6a7b/download",
  "expires_at_utc": "2026-05-01T10:00:00Z",
  "failure_reason": null,
  "filter_criteria": {
    "date_from_utc": "2026-04-01T00:00:00Z",
    "date_to_utc": "2026-04-30T23:59:59Z"
  },
  "finished_at_utc": "2026-05-01T10:00:00Z",
  "generated_at_utc": "2026-05-01T10:00:00Z",
  "generated_by": "users/b8e2f1a0-4c3d-4e5f-9a1b-2c3d4e5f6a7b",
  "id": "b8e2f1a0-4c3d-4e5f-9a1b-2c3d4e5f6a7b",
  "requested_scope": {
    "kind": "enterprise",
    "ref": "enterprises/b8e2f1a0-4c3d-4e5f-9a1b-2c3d4e5f6a7b"
  },
  "row_count": 150,
  "status": "ready",
  "storage_location": "s3://bucket/exports/ops-001.csv"
}
```

**400 Invalid request payload**

Invalid request payload, query, or parameter shape.

```json
{
  "code": "invalid_request",
  "details": {
    "reason": "invalid_date_range"
  },
  "message": "The export request is invalid."
}
```

**401 Caller is not authenticated or the bearer token is invalid**

Caller is not authenticated or the bearer token is invalid.

```json
{
  "code": "unauthorized",
  "message": "Authentication required."
}
```

**403 Caller lacks the required capability or permitted scope**

Caller lacks the required capability or permitted scope.

```json
{
  "code": "forbidden_capability_scope",
  "details": {
    "reason": "missing_capability"
  },
  "message": "Insufficient capability for this operation."
}
```

**409 State conflict — the request cannot be applied to the current resource state**

State conflict — the request cannot be applied to the current resource state.

```json
{
  "code": "state_conflict",
  "details": {
    "reason": "state_conflict"
  },
  "message": "The request cannot be applied to the current resource state."
}
```

**422 Operation is not admissible — it violates a business rule**

Operation is not admissible — it violates a business rule, policy constraint, or lifecycle precondition specific to this resource.

```json
{
  "code": "not_admissible",
  "details": {
    "reason": "not_admissible"
  },
  "message": "The operation is not admissible in the current state."
}
```

**429 Request rate limit exceeded**

Request rate limit exceeded. Retry after the delay indicated in the `details.retry_after_ms` field.

```json
{
  "code": "rate_limited",
  "details": {
    "retry_after_ms": 5000
  },
  "message": "Too many requests."
}
```

**502 Upstream service returned an unexpected error**

Upstream service returned an unexpected error.

```json
{
  "code": "upstream_error",
  "message": "An upstream service returned an unexpected error."
}
```

**503 Service is temporarily unavailable**

Service is temporarily unavailable; retry with backoff.

```json
{
  "code": "temporarily_unavailable",
  "details": {
    "reason": "service_temporarily_unavailable"
  },
  "message": "Service is temporarily unavailable."
}
```
