# Save and reuse request configurations

A saved configuration is a named request template for your workspace. Name it when you create a job or schedule with `scraping_config`, and the API applies the stored parameters before the request runs. One configuration can back many jobs: parameters you send explicitly override the template, so you can change the `url`, `timeout` or `extract_rules` per request without editing the configuration.

Owners and members can create configurations in the dashboard at [Saved configurations](https://dash.scrapingcow.com/configurations), or from their own session with the management endpoints below. Viewers have a read-only dashboard view, and the server rejects viewer writes. Configurations are a dashboard capability: a bearer API key can use a configuration by name, but cannot create, rename or delete one.

```bash
curl 'https://api.scrapingcow.com/platform/v1/configs' \
  -b session-cookies.txt -H "X-CSRF-Token: $CSRF_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"name":"rendered","request":{"render_js":false,"wait":500}}'
```

Then reference it when creating a job:

```bash
curl 'https://api.scrapingcow.com/platform/v1/jobs' \
  -H "Authorization: Bearer $API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"url":"https://example.com","scraping_config":"rendered"}'
```

## What a configuration may contain

- `name` — unique in your workspace, 1 to 128 characters, no control characters. Creating or renaming onto an existing name returns HTTP 409.
- `request` — a flat map of request parameters with scalar values only (strings, numbers, booleans or `null`).

Add one parameter per entry, such as `render_js`, `stealth_proxy`, `timeout` or a JSON string of extract rules. Structured values (objects or arrays) are rejected, because the executor reads parameters as a flat string map. Parameters that begin with `_` are supplied by the API or worker and cannot be set from a saved configuration; the API refuses such a template when you save it rather than failing at request time.

## Resolution rules

- `scraping_config` is resolved against your own workspace only. A name that does not exist is an HTTP 400 before any work is accepted: no job is created and no credits are reserved.
- Parameters you send explicitly win over the stored template, so a configuration is a default set rather than a fixed request.
- The configuration name is never stored on the job it was applied to.
- A blank `scraping_config` value is treated as absent.
- Deleting a configuration does not affect jobs that already used it; resolution happens once, when the job is created.

## Manage configurations

```text
GET    /platform/v1/configs
POST   /platform/v1/configs
GET    /platform/v1/configs/{id}
PATCH  /platform/v1/configs/{id}
DELETE /platform/v1/configs/{id}
```

The list returns your workspace's configurations ordered by name. `PATCH` updates `name` and/or `request`; omitted fields are unchanged, and a request that provides neither is rejected. Configurations belong to the workspace that created them: a configuration belonging to another workspace is not visible and returns HTTP 404 by its ID.

These endpoints accept only a dashboard session cookie with the `X-CSRF-Token` header. Reads require the owner, member or viewer role in the selected workspace; creating, updating and deleting require owner or member.
