> ## 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.

# Get Routing Strategy

> Retrieve a routing strategy by ID. Returns the full entity including routing content and metadata.



## OpenAPI

````yaml /openapi-specs/openapi.documented.yml get /routing-strategies/{id}
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:
  /routing-strategies/{id}:
    get:
      tags:
        - Routing Strategies
      summary: Get Routing Strategy
      description: >-
        Retrieve a routing strategy by ID. Returns the full entity including
        routing content and metadata.
      operationId: routingStrategies_retrieve
      parameters:
        - name: id
          in: path
          description: Routing strategy ID (rs_ prefix).
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoutingStrategyGetResponse'
              examples:
                FullStrategy:
                  value:
                    id: rs_01abc123
                    name: Email via SendGrid
                    description: Routes email through sendgrid with SES failover
                    tags:
                      - production
                      - email
                    routing:
                      method: single
                      channels:
                        - email
                    channels:
                      email:
                        providers:
                          - sendgrid
                          - ses
                    providers:
                      sendgrid:
                        override: {}
                    created: 1710000000000
                    creator: user_abc
                    updated: 1710000000000
                    updater: user_def
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
              examples:
                StrategyNotFound:
                  value:
                    type: invalid_request_error
                    message: Routing strategy rs_nonexistent not found
      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 routingStrategyGetResponse = await
            client.routingStrategies.retrieve('id');


            console.log(routingStrategyGetResponse.id);
        - 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
            )
            routing_strategy_get_response = client.routing_strategies.retrieve(
                "id",
            )
            print(routing_strategy_get_response.id)
        - 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\troutingStrategyGetResponse, err := client.RoutingStrategies.Get(context.TODO(), \"id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", routingStrategyGetResponse.ID)\n}\n"
        - lang: Java
          source: >-
            package com.courier.example;


            import com.courier.client.CourierClient;

            import com.courier.client.okhttp.CourierOkHttpClient;

            import
            com.courier.models.routingstrategies.RoutingStrategyGetResponse;

            import
            com.courier.models.routingstrategies.RoutingStrategyRetrieveParams;


            public final class Main {
                private Main() {}

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

                    RoutingStrategyGetResponse routingStrategyGetResponse = client.routingStrategies().retrieve("id");
                }
            }
        - lang: Ruby
          source: >-
            require "courier"


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


            routing_strategy_get_response =
            courier.routing_strategies.retrieve("id")


            puts(routing_strategy_get_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 {
              $routingStrategyGetResponse = $client->routingStrategies->retrieve('id');

              var_dump($routingStrategyGetResponse);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: C#
          source: >-
            using System;

            using Courier;

            using Courier.Models.RoutingStrategies;


            CourierClient client = new();


            RoutingStrategyRetrieveParams parameters = new() { ID = "id" };


            var routingStrategyGetResponse = await
            client.RoutingStrategies.Retrieve(parameters);


            Console.WriteLine(routingStrategyGetResponse);
        - lang: CLI
          source: |-
            courier routing-strategies retrieve \
              --api-key 'My API Key' \
              --id id
components:
  schemas:
    RoutingStrategyGetResponse:
      title: RoutingStrategyGetResponse
      type: object
      description: Full routing strategy entity returned by GET.
      properties:
        id:
          type: string
          description: The routing strategy ID (rs_ prefix).
        name:
          type: string
          description: Human-readable name.
        description:
          type: string
          nullable: true
          description: Description of the routing strategy.
        tags:
          type: array
          items:
            type: string
          nullable: true
          description: Tags for categorization.
        routing:
          $ref: '#/components/schemas/MessageRouting'
          description: Routing tree defining channel selection method and order.
        channels:
          $ref: '#/components/schemas/MessageChannels'
          description: Per-channel delivery configuration. May be empty.
        providers:
          $ref: '#/components/schemas/MessageProviders'
          description: Per-provider delivery configuration. May be empty.
        created:
          type: integer
          format: int64
          description: Epoch milliseconds when the strategy was created.
        creator:
          type: string
          description: User ID of the creator.
        updated:
          type: integer
          format: int64
          nullable: true
          description: Epoch milliseconds of last update.
        updater:
          type: string
          nullable: true
          description: User ID of the last updater.
      required:
        - id
        - name
        - routing
        - channels
        - providers
        - created
        - creator
    NotFound:
      title: NotFound
      type: object
      properties:
        type:
          type: string
          enum:
            - invalid_request_error
      required:
        - type
      allOf:
        - $ref: '#/components/schemas/BaseError'
    MessageRouting:
      title: MessageRouting
      type: object
      properties:
        method:
          $ref: '#/components/schemas/MessageRoutingMethod'
        channels:
          type: array
          items:
            $ref: '#/components/schemas/MessageRoutingChannel'
      required:
        - method
        - channels
    MessageChannels:
      title: MessageChannels
      type: object
      additionalProperties:
        $ref: '#/components/schemas/Channel'
    MessageProviders:
      title: MessageProviders
      type: object
      additionalProperties:
        $ref: '#/components/schemas/MessageProvidersType'
    BaseError:
      title: BaseError
      type: object
      properties:
        message:
          type: string
          description: A message describing the error that occurred.
      required:
        - message
    MessageRoutingMethod:
      title: MessageRoutingMethod
      type: string
      enum:
        - all
        - single
    MessageRoutingChannel:
      title: MessageRoutingChannel
      oneOf:
        - type: string
        - $ref: '#/components/schemas/MessageRouting'
    Channel:
      title: Channel
      type: object
      properties:
        brand_id:
          type: string
          nullable: true
          description: Brand id used for rendering.
        providers:
          type: array
          items:
            type: string
          nullable: true
          description: Providers enabled for this channel.
        routing_method:
          $ref: '#/components/schemas/RoutingMethod'
          nullable: true
          description: Defaults to `single`.
        if:
          type: string
          nullable: true
          description: JS conditional with access to data/profile.
        timeouts:
          $ref: '#/components/schemas/Timeouts'
          nullable: true
        override:
          type: object
          additionalProperties: true
          nullable: true
          description: Channel specific overrides.
        metadata:
          $ref: '#/components/schemas/ChannelMetadata'
          nullable: true
    MessageProvidersType:
      title: MessageProvidersType
      type: object
      properties:
        override:
          type: object
          additionalProperties: true
          nullable: true
          description: Provider-specific overrides.
        if:
          type: string
          nullable: true
          description: JS conditional with access to data/profile.
        timeouts:
          type: integer
          nullable: true
        metadata:
          $ref: '#/components/schemas/Metadata'
          nullable: true
    RoutingMethod:
      title: RoutingMethod
      type: string
      enum:
        - all
        - single
    Timeouts:
      title: Timeouts
      type: object
      properties:
        provider:
          type: integer
          nullable: true
        channel:
          type: integer
          nullable: true
    ChannelMetadata:
      title: ChannelMetadata
      type: object
      properties:
        utm:
          $ref: '#/components/schemas/UTM'
          nullable: true
    Metadata:
      title: Metadata
      type: object
      properties:
        utm:
          $ref: '#/components/schemas/UTM'
          nullable: true
    UTM:
      title: UTM
      type: object
      properties:
        source:
          type: string
          nullable: true
        medium:
          type: string
          nullable: true
        campaign:
          type: string
          nullable: true
        term:
          type: string
          nullable: true
        content:
          type: string
          nullable: true
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````