0

Get Sequence

by
Published today

Retrieves a single sequence by its ID.

Script outreach Verified

The script

Submitted by hugo989 Typescript (fetch-only)
Verified 5 hours ago
1
//native
2

3
/**
4
 * Get Sequence
5
 * Retrieves a single sequence by its ID.
6
 */
7
export async function main(auth: RT.Outreach, sequence_id: number) {
8
  const response = await fetch(
9
    `https://api.outreach.io/api/v2/sequences/${sequence_id}`,
10
    {
11
      headers: {
12
        Authorization: `Bearer ${auth.token}`,
13
        Accept: "application/vnd.api+json",
14
      },
15
    }
16
  )
17

18
  if (!response.ok) {
19
    throw new Error(`${response.status} ${await response.text()}`)
20
  }
21

22
  return await response.json()
23
}
24