> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.benchling.com/in-vivo/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.benchling.com/in-vivo/_mcp/server.

# Task specification created

POST 

Sent once per task specification created on a study. The payload is the task specification.

Reference: https://docs.benchling.com/in-vivo/webhooks/webhook-study-task-spec-created

## Request

### Headers

- `Signature` (string, required) — Lowercase hex-encoded HMAC-SHA256 of the raw request body, keyed with your webhook's signing secret. Compute it over the bytes exactly as received, before parsing, and compare in constant time.

### Payload

- `id` (string, required) — Unique identifier for a webhook event. A retried delivery carries the same identifier, so use it to discard duplicates.
- `event` (enum, required) — The event that occurred.
  - Allowed values: `study.task_spec.created`, `study.task_spec.updated`, `study.task_spec.deleted`
- `version` (enum, required) — A released version of the public API. Each OAuth client is registered against one version, which determines the response shape it receives.
  - Allowed values: `2022-12-14`
- `created_at` (datetime, required) — UTC timestamp with microsecond precision, always suffixed with `Z`, in the form `yyyy-MM-ddTHH:mm:ss.SSSSSSZ`.
- `payload` (TaskSpecV1, required) — A study task specification.
- `client_id` (string, optional) — The OAuth client whose API request caused the event. Omitted when the event did not originate from an API request, and on events that never carry it.

## Types

### TaskSpecV1

A study task specification.

- `id` (string, required) — Unique identifier for a study task specification.
- `title` (string, required) — The title of the task specification.
- `description` (string, required, nullable) — The description of the task specification.
- `type` (enum, required) — The kind of work a task specification describes.
  - Allowed values: `measurement`, `sample`, `observation`, `dosing`, `other`
- `execution` (TaskExecutionV1, required, nullable) — Execution configuration for typed task specs. Null for `other` task specs.
- `schedule` (TaskScheduleV1, required) — Schedule for a task specification. The `type` discriminator selects which of `one_off`, `recurring` or `conditional` is present; the others are omitted. `timezone` is set from the study on create and always returned on read.
- `target` (TaskTargetTypeV1, required) — Target type embedded on a task specification response.
- `study` (StudyNestedV1, required) — The study a record belongs to, as embedded in animals, dosages, measurements, observations and samples. Carries the same attributes as a study retrieved directly, except that the project is given as an identifier rather than an embedded object.
- `created_at` (datetime, required) — UTC timestamp with microsecond precision, always suffixed with `Z`, in the form `yyyy-MM-ddTHH:mm:ss.SSSSSSZ`.
- `updated_at` (datetime, required) — UTC timestamp with microsecond precision, always suffixed with `Z`, in the form `yyyy-MM-ddTHH:mm:ss.SSSSSSZ`.

### TaskExecutionV1

Execution configuration for a typed task specification. `type` selects the variant, which carries only its own workflow object.

- `type`: `measurement_workflow` (TaskExecutionMeasurementV1)
  - `measurement_workflow` (WorkflowTemplateMeasurementV1, required, nullable) — The measurement workflow template. Null in task specification lists and `study.task_spec.*` webhooks, which carry no template.
- `type`: `sample_workflow` (TaskExecutionSampleV1)
  - `sample_workflow` (WorkflowTemplateSampleV1, required, nullable) — The sample workflow template. Null in task specification lists and `study.task_spec.*` webhooks, which carry no template.
- `type`: `observation_workflow` (TaskExecutionObservationV1)
  - `observation_workflow` (WorkflowTemplateObservationV1, required, nullable) — The observation workflow template. Null in task specification lists and `study.task_spec.*` webhooks, which carry no template.
- `type`: `dosing_workflow` (TaskExecutionDosingV1)
  - `dosing_workflow` (WorkflowTemplateDosingV1, required, nullable) — The dosing workflow template. Null in task specification lists and `study.task_spec.*` webhooks, which carry no template.

### TaskScheduleV1

Schedule for a task specification. The `type` discriminator selects which of `one_off`, `recurring` or `conditional` is present; the others are omitted. `timezone` is set from the study on create and always returned on read.

- `time` (TaskTimeDurationV1, required) — Time-of-day configuration for a scheduled task. When `type` is `timed`, the nested `timed` object carries the window; when `type` is `all_day`, `timed` is omitted.
- `timezone` (string, required) — IANA timezone of the schedule. Derived from the study on create.
- `type` (enum, required) — How a task specification is scheduled.
  - Allowed values: `one_off`, `recurring`, `conditional`
- `one_off` (TaskScheduleOneOffDetailsV1, optional) — Details for a one-off schedule.
- `recurring` (TaskScheduleRecurringDetailsV1, optional) — Details for a recurring schedule.
- `conditional` (TaskScheduleConditionalDetailsV1, optional) — Details for a conditional schedule.

### TaskTargetTypeV1

Target type embedded on a task specification response.

- `type` (enum, required) — What a task specification is aimed at.
  - Allowed values: `animal`, `group`

### StudyNestedV1

The study a record belongs to, as embedded in animals, dosages, measurements, observations and samples. Carries the same attributes as a study retrieved directly, except that the project is given as an identifier rather than an embedded object.

- `id` (string, required) — Unique identifier for a study.
- `project_id` (string, required, nullable) — The project of the study. Null when the study is not in a project.
- `name` (string, required) — The name of the study.
- `code` (string, required, nullable) — The code of the study.
- `study_code_id` (string, required, nullable) — The unique identifier of the study code template.
- `type` (enum, required) — Whether the study is run in-house or by an external partner. The `all` value accepted by some filters is not a valid study type and is never returned.
  - Allowed values: `internal`, `external`
- `status` (enum, required) — Review status of a study.
  - Allowed values: `awaiting_approval`, `in_progress`, `rejected`
- `description` (string, required, nullable) — The description of the study.
- `timezone` (string, required, nullable) — The timezone of the study, as an IANA timezone identifier.
- `metadata` (map from string to any, required, nullable) — The metadata associated to the study.
- `author` (StudyAuthorUserV1, required, nullable) — The author of the study.
- `owner` (StudyAuthorUserV1, required, nullable) — The owner of the study.
- `started_on` (date, required) — Calendar date with no time or offset component, in ISO-8601 form.
- `tracking_day_base` (integer, required, nullable) — The day number assigned to the study's start date, from which all subsequent tracking days are counted.
- `completed_at` (datetime, required, nullable) — The completed timestamp of the study.
- `canceled_at` (datetime, required, nullable) — The canceled timestamp of the study.
- `created_at` (datetime, required) — UTC timestamp with microsecond precision, always suffixed with `Z`, in the form `yyyy-MM-ddTHH:mm:ss.SSSSSSZ`.
- `updated_at` (datetime, required) — UTC timestamp with microsecond precision, always suffixed with `Z`, in the form `yyyy-MM-ddTHH:mm:ss.SSSSSSZ`.

### WorkflowTemplateMeasurementV1

Measurement settings for a measurement task specification.

- `measurements` (list of string, required, nullable) — Measurement variable slugs to record.
- `weight_percentage_change` (enum, required, nullable) — Baseline for weight percentage change tracking.
  - Allowed values: `first_measurement`, `latest_measurement`, `maximum_measurement`, `tracking_date`, `disease_induction_date`
- `assign_identifier` (enum, required, nullable) — Identifier assignment strategy. Null when none is configured.
  - Allowed values: `donor`, `ear`, `tag`, `tail`
- `cursor_position` (string, required, nullable) — Cursor position for measurement entry. Must be one of the values in `measurements` when set.

### WorkflowTemplateSampleV1

Sample-collection settings for a sample task specification.

- `samples` (list of string, required) — Team glossary identifiers of the samples to collect.
- `auto_generate_sample_id` (boolean, required) — Whether sample identifiers are generated automatically.

### WorkflowTemplateObservationV1

Observation settings for an observation task specification.

- `observations` (list of string, required) — Team glossary identifiers of the observations to record.

### WorkflowTemplateDosingV1

Dosing settings for a dosing task specification.

- `treatments` (list of string, required) — Treatments to administer.
- `skip_dosing_for_un_required_animals` (boolean, required) — Whether dosing is skipped for animals that do not require it.
- `use_new_body_weight` (boolean, required) — Whether a newly measured body weight is used for dosing.

### TaskTimeDurationV1

Time-of-day configuration for a scheduled task. When `type` is `timed`, the nested `timed` object carries the window; when `type` is `all_day`, `timed` is omitted.

- `type` (enum, required) — Whether a scheduled task fills the whole day or a timed window.
  - Allowed values: `all_day`, `timed`
- `timed` (TaskTimeTimedDetailsV1, optional) — Start and end times for a timed task window.

### TaskScheduleOneOffDetailsV1

Details for a one-off schedule.

- `duration` (TaskDurationV1, required) — Inclusive calendar date range for a one-off or recurring schedule.

### TaskScheduleRecurringDetailsV1

Details for a recurring schedule.

- `duration` (TaskDurationV1, required) — Inclusive calendar date range for a one-off or recurring schedule.
- `repeat` (TaskRepeatValueV1, required) — Repeat interval for a recurring schedule.

### TaskScheduleConditionalDetailsV1

Details for a conditional schedule.

- `condition` (TaskConditionalV1, required) — Condition that triggers a conditional schedule.

### StudyAuthorUserV1

A user referenced as the author or owner of a study.

- `id` (string, required) — Unique identifier for a user.
- `name` (string, required) — The name of the user.
- `email` (string, required) — The email address of the user.
- `timezone` (string, required) — The timezone of the user. Defaults to `UTC` when the user has none set.

### TaskTimeTimedDetailsV1

Start and end times for a timed task window.

- `from` (string, required) — Time of day with no date or offset, in ISO-8601 local time form.
- `to` (string, required) — Time of day with no date or offset, in ISO-8601 local time form.

### TaskDurationV1

Inclusive calendar date range for a one-off or recurring schedule.

- `start` (date, required, nullable) — Inclusive start date of the schedule window.
- `end` (date, required, nullable) — Inclusive end date of the schedule window.

### TaskRepeatValueV1

Repeat interval for a recurring schedule.

- `value` (integer, required) — How many `unit`s between occurrences.
- `unit` (enum, required) — The unit for a recurring schedule interval.
  - Allowed values: `days`, `weeks`
- `on_day` (list of enum, required, nullable) — Days of the week when `unit` is `weeks`. Null when the repeat is not weekly.
  - Allowed values: `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`

### TaskConditionalV1

Condition that triggers a conditional schedule.

- `type` (enum, required) — The condition that triggers a conditional schedule.
  - Allowed values: `age`, `study_day`, `tracking_day`
- `value` (list of integer, required) — Condition values (for example study-day numbers).
- `unit` (enum, required) — The unit for a conditional schedule value.
  - Allowed values: `days`, `weeks`