> ## Documentation Index
> Fetch the complete documentation index at: https://www.courier.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# List Journeys

> Get the list of journeys.



## OpenAPI

````yaml /openapi-specs/openapi.documented.yml get /journeys
openapi: 3.0.1
info:
  title: Courier
  description: The Courier REST API.
  version: 0.0.1
servers:
  - url: https://api.courier.com
    description: Production
security: []
paths:
  /journeys:
    get:
      tags:
        - Journeys
      summary: List Journeys
      description: Get the list of journeys.
      operationId: journeys_list
      parameters:
        - name: cursor
          in: query
          description: >-
            A cursor token for pagination. Use the cursor from the previous
            response to fetch the next page of results.
          required: false
          schema:
            type: string
        - name: version
          in: query
          description: >-
            The version of journeys to retrieve. Accepted values are published
            (for published journeys) or draft (for draft journeys). Defaults to
            published.
          required: false
          schema:
            type: string
            enum:
              - published
              - draft
            default: published
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JourneysListResponse'
              examples:
                Example1:
                  value:
                    templates:
                      - name: Welcome Journey
                        id: abc-123-def-456
                        version: published
                        createdAt: '2024-01-01T00:00:00Z'
                        updatedAt: '2024-01-02T00:00:00Z'
                      - name: Onboarding Flow
                        id: xyz-789-ghi-012
                        version: published
                        createdAt: '2024-01-03T00:00:00Z'
                        updatedAt: '2024-01-04T00:00:00Z'
                    cursor: eyJpZCI6InRlbXBsYXRlLTIifQ==
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
              examples:
                InvalidVersion:
                  value:
                    type: invalid_request_error
                    message: >-
                      Invalid version parameter "invalid". Accepted values are:
                      published (for published templates) or draft (for draft
                      templates)
                InvalidCursor:
                  value:
                    type: invalid_request_error
                    message: Invalid cursor format
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Courier from '@trycourier/courier';

            const client = new Courier({
              apiKey: process.env['COURIER_API_KEY'], // This is the default and can be omitted
            });

            const journeysListResponse = await client.journeys.list();

            console.log(journeysListResponse.cursor);
        - lang: Python
          source: |-
            import os
            from courier import Courier

            client = Courier(
                api_key=os.environ.get("COURIER_API_KEY"),  # This is the default and can be omitted
            )
            journeys_list_response = client.journeys.list()
            print(journeys_list_response.cursor)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/trycourier/courier-go\"\n\t\"github.com/trycourier/courier-go/option\"\n)\n\nfunc main() {\n\tclient := courier.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tjourneysListResponse, err := client.Journeys.List(context.TODO(), courier.JourneyListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", journeysListResponse.Cursor)\n}\n"
        - lang: Java
          source: |-
            package com.courier.example;

            import com.courier.client.CourierClient;
            import com.courier.client.okhttp.CourierOkHttpClient;
            import com.courier.models.journeys.JourneyListParams;
            import com.courier.models.journeys.JourneysListResponse;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    CourierClient client = CourierOkHttpClient.fromEnv();

                    JourneysListResponse journeysListResponse = client.journeys().list();
                }
            }
        - lang: Ruby
          source: |-
            require "courier"

            courier = Courier::Client.new(api_key: "My API Key")

            journeys_list_response = courier.journeys.list

            puts(journeys_list_response)
        - lang: PHP
          source: >-
            <?php


            require_once dirname(__DIR__) . '/vendor/autoload.php';


            use Courier\Client;

            use Courier\Core\Exceptions\APIException;


            $client = new Client(apiKey: getenv('COURIER_API_KEY') ?: 'My API
            Key');


            try {
              $journeysListResponse = $client->journeys->list(
                cursor: 'cursor', version: 'published'
              );

              var_dump($journeysListResponse);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: C#
          source: |-
            using System;
            using Courier;
            using Courier.Models.Journeys;

            CourierClient client = new();

            JourneyListParams parameters = new();

            var journeysListResponse = await client.Journeys.List(parameters);

            Console.WriteLine(journeysListResponse);
        - lang: CLI
          source: |-
            courier journeys list \
              --api-key 'My API Key'
components:
  schemas:
    JourneysListResponse:
      title: JourneysListResponse
      type: object
      properties:
        templates:
          type: array
          items:
            $ref: '#/components/schemas/Journey'
        cursor:
          type: string
          description: >-
            A cursor token for pagination. Present when there are more results
            available.
    BadRequest:
      title: BadRequest
      type: object
      properties:
        type:
          type: string
          enum:
            - invalid_request_error
      required:
        - type
      allOf:
        - $ref: '#/components/schemas/BaseError'
    Journey:
      title: Journey
      type: object
      description: A journey template representing an automation workflow.
      properties:
        name:
          type: string
          description: The name of the journey.
        id:
          type: string
          description: The unique identifier of the journey.
        version:
          type: string
          description: The version of the journey (published or draft).
          enum:
            - published
            - draft
        createdAt:
          type: string
          format: date-time
          description: ISO 8601 timestamp when the journey was created.
        updatedAt:
          type: string
          format: date-time
          description: ISO 8601 timestamp when the journey was last updated.
      required:
        - name
        - id
        - version
    BaseError:
      title: BaseError
      type: object
      properties:
        message:
          type: string
          description: A message describing the error that occurred.
      required:
        - message
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````