# Create and update

These endpoints create and edit the journey definition: its title, settings, and the points on the canvas. They do not start the journey. Use [Lifecycle](/developer/api-reference/customer-journey-api/lifecycle/) for that.

Both accept and return the [journey object](/developer/api-reference/customer-journey-api/journey-object/).

<Aside type="tip">
Writing a full journey graph in JSON is hard. Each point has its own channel fields and conditions ([Point reference](/developer/api-reference/customer-journey-api/point-reference/)). The most reliable workflow is to build the journey once in the [Customer Journey builder](/product/customer-journey/pushwoosh-journey-overview/), read it back from a create/update response, then use these endpoints to clone or adjust it programmatically.
</Aside>

## Create

`POST` `https://journey.pushwoosh.com/api/v3/journeygateway`

Creates a new journey in the `STATUS_DRAFT` state.

### Request

| Field | Required | Type | Description |
|---|---|---|---|
| `title` | Yes | string | Journey name. |
| `params` | Yes | [`JourneyParams`](/developer/api-reference/customer-journey-api/journey-object/#journeyparams) | Journey-wide configuration. `params.application_code` is required. |
| `points` | No | array of [`Point`](/developer/api-reference/customer-journey-api/journey-object/#point) | Journey elements on the canvas and their connections. |
| `comments` | No | array of [`JourneyComment`](/developer/api-reference/customer-journey-api/journey-object/#journeycomment) | Canvas comments. |

##### Request example
```bash title="Create a journey"
curl -X POST https://journey.pushwoosh.com/api/v3/journeygateway \
  -H "Authorization: Api YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Welcome series",
    "params": { "application_code": "XXXXX-XXXXX" },
    "points": [],
    "comments": []
  }'
```

### Response

Returns the new [journey object](/developer/api-reference/customer-journey-api/journey-object/). Read the journey's UUID from `info.uuid` and use it for subsequent update and lifecycle calls.
##### Response example
```json
{
  "info": {
    "uuid": "11111111-2222-3333-4444-555555555555",
    "title": "Welcome series",
    "status": "STATUS_DRAFT",
    "params": { "application_code": "XXXXX-XXXXX" }
  },
  "points": [],
  "comments": []
}
```

## Full journey example

A complete `Create` body for a small welcome flow. The graph is:

```
Start by segment ──default──▶ Send push ──default──▶ Wait 1 day ──default──▶ Boolean splitter ──output1──▶ Send email ──default──▶ Exit
                                                                                              └──default───────────────────────────▶ Exit
```

Points are wired together through each output's `info.next_point_uuid`. Note the [output keys](/developer/api-reference/customer-journey-api/journey-object/#output-keys): every point uses `default`, except the boolean splitter, which adds `output1` for the matched-condition branch (`default` is its fallback). The exit point has no outputs.

```json
{
  "title": "Welcome series",
  "params": {
    "application_code": "XXXXX-XXXXX",
    "user_id_track_change_policy": "TRACK"
  },
  "points": [
    {
      "uuid": "11111111-1111-1111-1111-111111111111",
      "title": "New signups",
      "point_type": "POINT_TYPE_START_BY_SEGMENT",
      "position": { "x": 80, "y": 200 },
      "outputs": [
        { "identity": { "key": "default", "order": 0 },
          "info": { "title": "", "next_point_uuid": "22222222-2222-2222-2222-222222222222" } }
      ],
      "point_data": {
        "start_by_segment": {
          "application_code": "XXXXX-XXXXX",
          "filter_code": "AAAAA-BBBBB"
        }
      }
    },
    {
      "uuid": "22222222-2222-2222-2222-222222222222",
      "title": "Welcome push",
      "point_type": "POINT_TYPE_SEND_PUSH",
      "position": { "x": 340, "y": 200 },
      "outputs": [
        { "identity": { "key": "default", "order": 0 },
          "info": { "title": "", "next_point_uuid": "33333333-3333-3333-3333-333333333333" } }
      ],
      "point_data": {
        "send_push": {
          "application_code": "XXXXX-XXXXX",
          "title": "Welcome!",
          "content": "Thanks for joining — here's how to get started."
        }
      }
    },
    {
      "uuid": "33333333-3333-3333-3333-333333333333",
      "title": "Wait 1 day",
      "point_type": "POINT_TYPE_WAIT",
      "position": { "x": 600, "y": 200 },
      "outputs": [
        { "identity": { "key": "default", "order": 0 },
          "info": { "title": "", "next_point_uuid": "44444444-4444-4444-4444-444444444444" } }
      ],
      "point_data": {
        "delay": { "sec": 86400 }
      }
    },
    {
      "uuid": "44444444-4444-4444-4444-444444444444",
      "title": "Opened the push?",
      "point_type": "POINT_TYPE_BOOLEAN_SPLITTER",
      "position": { "x": 860, "y": 200 },
      "outputs": [
        { "identity": { "key": "output1", "order": 1 },
          "info": { "title": "Matched", "next_point_uuid": "55555555-5555-5555-5555-555555555555" } },
        { "identity": { "key": "default", "order": 0 },
          "info": { "title": "Everyone else", "next_point_uuid": "66666666-6666-6666-6666-666666666666" } }
      ],
      "point_data": {
        "boolean_splitter": {
          "application_code": "XXXXX-XXXXX",
          "split_strategy": "SPLIT_FILTER",
          "load_policy": "ALL",
          "filter_code": "CCCCC-DDDDD"
        }
      }
    },
    {
      "uuid": "55555555-5555-5555-5555-555555555555",
      "title": "Follow-up email",
      "point_type": "POINT_TYPE_SEND_EMAIL",
      "position": { "x": 1120, "y": 120 },
      "outputs": [
        { "identity": { "key": "default", "order": 0 },
          "info": { "title": "", "next_point_uuid": "66666666-6666-6666-6666-666666666666" } }
      ],
      "point_data": {
        "send_email": {
          "application_code": "XXXXX-XXXXX",
          "preset_code": "12345-67890"
        }
      }
    },
    {
      "uuid": "66666666-6666-6666-6666-666666666666",
      "title": "Exit",
      "point_type": "POINT_TYPE_EXIT",
      "position": { "x": 1380, "y": 200 },
      "outputs": [],
      "point_data": {
        "terminator": {}
      }
    }
  ],
  "comments": []
}
```

## Update

`PUT` `https://journey.pushwoosh.com/api/v3/journeygateway/{uuid}`

Replaces the definition of an existing journey. Send the **complete** definition. The points and comments you submit replace the current ones.

### Path parameters

| Name | Type | Description |
|---|---|---|
| `uuid` | string | [Journey ID](/developer/api-reference/api-identifiers/#journey-id) to update. |

### Request

| Field | Type | Description |
|---|---|---|
| `title` | string | New journey name. |
| `params` | [`JourneyParams`](/developer/api-reference/customer-journey-api/journey-object/#journeyparams) | New journey-wide configuration. |
| `points` | array of [`Point`](/developer/api-reference/customer-journey-api/journey-object/#point) | New full set of points. |
| `comments` | array of [`JourneyComment`](/developer/api-reference/customer-journey-api/journey-object/#journeycomment) | New full set of comments. |
| `autosave` | bool | When `true`, the change is treated as an editor autosave. Defaults to `false`. |

##### Request example 

```bash title="Rename and reconfigure a journey"
curl -X PUT https://journey.pushwoosh.com/api/v3/journeygateway/11111111-2222-3333-4444-555555555555 \
  -H "Authorization: Api YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Welcome series v2",
    "params": { "application_code": "XXXXX-XXXXX" },
    "points": [],
    "comments": []
  }'
```

### Response

Returns the updated [journey object](/developer/api-reference/customer-journey-api/journey-object/).

## Update and resume

`POST` `https://journey.pushwoosh.com/api/v3/journeygateway/{uuid}/resume`

Applies edits to a journey and resumes it in a single call. This is the equivalent of an [Update](#update) followed by a lifecycle [Start](/developer/api-reference/customer-journey-api/lifecycle/). The request body matches [Update](#update). Use this when editing a paused journey you want to put back into the `STATUS_RUNNING` state.

## Rename

`POST` `https://journey.pushwoosh.com/api/v3/journeygateway/{uuid}/rename`

Changes only the journey title, without touching its points or settings.

| Field | Required | Type | Description |
|---|---|---|---|
| `title` | Yes | string | New journey name. |

##### Request example

```bash title="Rename a journey"
curl -X POST https://journey.pushwoosh.com/api/v3/journeygateway/11111111-2222-3333-4444-555555555555/rename \
  -H "Authorization: Api YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "title": "Welcome series (Q3)" }'
```

## Related

<CardGrid>
  <LinkCard title="Journey object" href="/developer/api-reference/customer-journey-api/journey-object/" />
  <LinkCard title="Lifecycle" href="/developer/api-reference/customer-journey-api/lifecycle/" />
  <LinkCard title="Start by API" href="/developer/api-reference/customer-journey-api/start-by-api/" />
</CardGrid>