Skip to content
Navigation

Add a task

POST
https://api.nicer.travel/crm/tasks

Adds one task about one traveler (travelerId) or one trip (travelersTripId), assigned to the caller unless assignedUserId says otherwise, and publishes crm.task-changed.v1 with action CREATED. Answers the task, named after what it is about (travelerName, or tripName with associatedTripItineraryId). To add the tasks of one of the agency's task templates to a trip, apply the template instead (POST /crm/task-templates/{templateId}/apply). Requires an Idempotency-Key header: a retry with the same key and body answers the same task. Errors: 400 ERROR_BODY_VALIDATION, 404 ERROR_ITEM_NOT_FOUND for a traveler or trip the caller may not write about, 409 CRM_IDEMPOTENCY_CONFLICT for a key used with another body.

Authorization

  • bearerAuth
    HTTP Bearer (JWT)
    required

    Authorization: Bearer <token>

Header parameters

  • Idempotency-Key
    string
    required

    Unique key (8–255 chars) per request; replays return the original result.

  • x-nicer-company
    string
    required

    Company context. Authentication and tenant membership are validated by the API.

  • X-Nicer-CRM-Contract
    resource
    required
    example: "resource"

Request body JSON required

  • title
    string
    required

    What to do, in a few words: 1 to 255 characters once trimmed.

    maxLength: 255 · minLength: 1
  • assignedUserId
    optional

    The user id of the advisor or admin who should do it; null assigns nobody. The caller when left out.

    Any of the following:

    • string
    • null
  • notes
    optional

    More about it, 1 to 2,000 characters once trimmed.

    Any of the following:

    • string
    • null
  • tentativeDate
    optional

    When it should be done, as YYYY-MM-DD.

    Any of the following:

    • string
    • null
  • travelerId
    optional
    string

    The traveler (TRV…) the task is about. Required unless travelersTripId is sent; never both.

    maxLength: 64 · minLength: 1
  • travelersTripId
    optional
    string

    The trip (TT…) the task is about. Required unless travelerId is sent; never both.

    minLength: 1

Returns

200

OK

JSON
  • assignedUserId
    required

    The advisor or admin who should do it; null when nobody is assigned.

    Any of the following:

    • string
    • null
  • associatedTripItineraryId
    required

    The itinerary (TI…) of the trip the task is about, when it has one; null otherwise.

    Any of the following:

    • string
    • null
  • companyName
    string
    required

    The agency the task belongs to.

  • completed
    boolean
    required

    Whether the task is done.

  • completedAt
    required

    When the task was marked done; null while it is open.

    Any of the following:

    • string
    • null
  • createdAt
    string
    required

    When the task was created.

    format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
  • createdBy
    string
    required

    The user id of who created it, or SYSTEM for the CRM.

  • lastModifiedBy
    string
    required

    The user id of who changed it last, or SYSTEM for the CRM.

  • notes
    required

    More about it; null when there is none.

    Any of the following:

    • string
    • null
  • origin
    ANNIVERSARY
    or
    BIRTHDAY
    or
    DOCUMENT_EXPIRY
    or
    MANUAL
    or
    TEMPLATE
    required

    How the task was made.

  • taskId
    string
    required

    The task's id: what updateTask and deleteTask take.

  • tentativeDate
    required

    When it should be done, as a date; null when undated.

    Any of the following:

    • string
    • null
  • title
    string
    required

    What to do, in a few words.

  • travelerId
    required

    The traveler the task is about; null for a task about a trip. A task is about one traveler or one trip.

    Any of the following:

    • TravelerId
    • null
  • travelerName
    required

    The traveler's name as the agency knows them, read when the task is answered; null for a task about a trip.

    Any of the following:

    • string
    • null
  • travelersTripId
    required

    The trip (TT…) the task is about; null for a task about a traveler.

    Any of the following:

    • string
    • null
  • tripName
    required

    The trip's name, read when the task is answered; null for a task about a traveler or a trip without a name.

    Any of the following:

    • string
    • null
  • updatedAt
    string
    required

    When the task last changed.

    format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$

400

Request failed. errorCode is stable; errorMessage is for humans.
JSON
  • errorCode
    string
    required
  • errorMessage
    string
    required

401

Request failed. errorCode is stable; errorMessage is for humans.
JSON
  • errorCode
    string
    required
  • errorMessage
    string
    required

403

Request failed. errorCode is stable; errorMessage is for humans.
JSON
  • errorCode
    string
    required
  • errorMessage
    string
    required

Type to search…

↑↓ navigate↵ selectEsc close