# Create Submission Type

Creates a submission type for an existing pathway in the requesting practice group.

Endpoint: POST /v1/care-nav/submission-types
Version: 1.0.0
Security: apiKeyAuth, practiceGroupId

## Security:

  - `apiKeyAuth` (unknown)
    apiKey in header x-api-key

  - `practiceGroupId` (unknown)
    apiKey in header x-practice-group-id

## Request fields (application/json):

  - `title` (string, required)

  - `description` (string)

  - `in_hours` (boolean)

  - `out_of_hours` (boolean)

  - `suspended` (boolean)

  - `form_id` (string)

  - `external_url` (string)

  - `external_url_name` (string)

  - `type` (string)
    Enum: "admin_request", "clinical_request", "other_request"

  - `default_priority` (string)
    Enum: "lowest", "low", "medium", "high", "highest"

  - `daily_limit` (integer)

  - `patient_eligibility_check` (boolean)

  - `assignee_id` (string)

  - `assignee_type` (string)
    Enum: "Admin", "AdminTeam"

  - `order` (integer)

  - `pathway_id` (string, required)

## Response 201:

  - `201` (unknown)
    Created

## Response 201 fields (application/json):

  - `id` (string, required)

  - `pathway_id` (string, required)

  - `form_id` (string, required)

  - `title` (string, required)

  - `description` (string, required)

  - `in_hours` (boolean, required)

  - `out_of_hours` (boolean, required)

  - `suspended` (boolean, required)

  - `external_url` (string, required)

  - `external_url_name` (string, required)

  - `type` (string, required)
    Enum: "admin_request", "clinical_request", "other_request"

  - `default_priority` (string, required)
    Enum: "lowest", "low", "medium", "high", "highest"

  - `daily_limit` (integer, required)

  - `forms_submitted_today` (integer, required)
    Number of forms submitted for this submission type on the current day.

  - `patient_eligibility_check` (boolean, required)

  - `assignee_id` (string, required)

  - `assignee_type` (string, required)
    Enum: "Admin", "AdminTeam"

  - `order` (number, required)

  - `patient_url` (string, required)
    A link patients can open to go straight here in the practice’s online care navigation. If this is later deleted, suspended, out of hours or at its daily limit, the link still opens and tells the patient why. While the practice has paused care navigation as a whole, it opens the practice's own paused message instead.

  - `available_now` (boolean, required)
    Whether a patient opening patient_url now could choose this, as the patient pages work it out.

  - `unavailable_reason` (string, required)
    Why patients cannot choose this now: service_suspended (the practice has paused care navigation), suspended (this pathway or option is suspended, or the pathway an option is in), no_options (a pathway with no option patients can choose: none, or every one offered now is suspended), not_listed (patients are not shown it, e.g. its form has no questions yet), in_hours_only (offered only while the practice is open, and it is closed), out_of_hours_only (offered only while it is closed, and it is open), daily_limit (it has taken as many requests as it can today).
    Enum: "service_suspended", "suspended", "no_options", "not_listed", "in_hours_only", "out_of_hours_only", "daily_limit"

  - `created_at` (string, required)

  - `updated_at` (string, required)

## Response 400:

  - `400` (unknown)
    Validation error

## Response 400 fields (application/json):

  - `error` (boolean, required)
    Example: true

  - `statusCode` (number, required)
    Example: 400

  - `message` (array, required)

  - `message.code` (string, required)
    Example: invalid_type

  - `message.expected` (string, required)
    Example: string

  - `message.path` (array, required)
    Example: ["patient_id"]

  - `message.message` (string, required)
    Example: Required

## Response 401:

  - `401` (unknown)
    Unauthorised

## Response 422:

  - `422` (unknown)
    Business rule violation

## Response 422 fields (application/json):

  - `requestId` (string)
    Example: 3f2b8c1e-6a4d-4e2f-9b1a-7c5d2e8f0a13

  - `error` (boolean, required)
    Example: true

  - `statusCode` (number, required)
    Example: 422

  - `code` (string, required)
    Example: internal_api_error

  - `message` (string, required)
    Example: Validation failed: Form must belong to the practice group

  - `errors` (array)
    Each problem the API can place on a field of the request. The path names the field, and the message is worded to follow its name. A path that ends at an item of a list, or is empty, is a problem with that item or the request as a whole, and its message is a whole sentence.

  - `errors.path` (array, required)
    Example: ["submission_types",1,"form_id"]

  - `errors.message` (string, required)
    Example: must belong to the practice group

## Response 429:

  - `429` (unknown)
    Too Many Requests

## Response 500:

  - `500` (unknown)
    Unknown error

