AI, API & IntegrationsNov 27, 202620 min read

REST API Example: Read Scribe Analytics Safely

Learn how to read a REST API example, call documented Scribe analytics endpoints, validate responses, and handle webhook events.

SG

Sophie Grant

Email Signature Specialist, Scribe

Start with the request pattern

A REST request has five parts to understand before you connect it to another system: the HTTP method, the resource URL, the authentication headers, the request content if the method permits it, and the response returned by the server. HTTP methods indicate the action a client wants to perform on a resource, and every REST API request includes one. A REST request identifies a resource with a URI, while the server can return a representation such as JSON. That separation matters because your integration should process the documented response representation rather than assume how the service stores the underlying data.

For a read operation, use GET. The GET method requests a resource representation for retrieval and should not contain request content. The method tells the server what you want to do; the URL tells it which resource to address. The response then gives your receiving system data to parse, validate, store, display, or pass to another process.

Read a request in this order:

  • Method: Confirm that GET is being used for retrieval rather than an operation that changes data.
  • URL: Identify the base URL, API version, resource path, and any documented resource identifier or query parameters.
  • Headers: Check authentication and the media type requirements stated by the API documentation.
  • Response: Determine which status code means success and how the response body represents the result.
  • Failure path: Decide what your integration does when the server returns an error instead of the expected representation.

A GET request can retrieve a collection or a specific resource, but the exact path and parameters belong to the API contract you are using. Status codes should match outcomes: 201 can indicate a created resource, 204 can indicate success without a response body, and 404 can indicate that a resource was not found. For other failures, 400 indicates bad or unexpected request data, 401 indicates that authentication is required, 403 indicates insufficient permissions, and 405 means a different method should be used.

Get started with Scribe

Let AI build your signature — from a screenshot

Free 14-day trial — no credit card.

Place the example in the Scribe API

Our REST API is useful when the data your workflow needs is exposed through a resource contract that your receiving system can request, interpret, and process. Our API lets you manage email signatures, teammates, smart fields, folders, assets, and marketing campaigns programmatically. The right starting point is therefore not a generic integration recipe. It is the specific resource and operation that match the data your system needs.

Our API uses JSON over HTTPS for requests and responses, resources use UUIDs, and the API is versioned under /v1. These details give you the shape of the request boundary. Your client sends an HTTPS request to a versioned path, authenticates it as the documentation requires, and handles a JSON representation returned by the API. The fields inside that representation still need to be taken from the endpoint contract rather than guessed from the resource name.

Use [https://api.scribe-mail.com/v1](https://www.scribe-mail.com/en-US/api) as the Scribe API base URL. Treat the base URL and the resource path as separate pieces while you build the integration. The base identifies the API service and version; the path identifies the operation or resource. This makes it easier to compare your client configuration with the endpoint documentation and to spot a missing version segment or an incorrect resource path before you investigate response data.

A suitable adaptation starts with a narrow use case. If your system needs a documented analytics result, begin with the analytics endpoint and its published contract. If it needs a change notification, compare that requirement with the webhook event documentation instead of repeatedly requesting data. In both cases, record the method, complete URL, authentication requirement, expected response representation, and failure handling as part of the integration design.

Read a documented analytics request

Our documented signature-view analytics request gives you a concrete read operation to study. It uses GET at https://api.scribe-mail.com/v1/analytics/views and includes an Authorization: Bearer <token> header. The method requests data, the URL identifies the analytics resource, and the bearer token authenticates the request. The response body is the representation your integration must parse, but its fields and supported parameters must come from the current endpoint contract.

That last boundary is part of the example, not a minor footnote. The endpoint name tells you the request is for signature-view analytics; it does not tell you which date filters, dimensions, pagination fields, or response properties your implementation may use. Keep those details configurable only after you have matched them to the current public OpenAPI specification. Do not copy a field into production merely because a similarly named analytics service uses it.

curl --request GET \
  --url https://api.scribe-mail.com/v1/analytics/views \
  --header 'Authorization: Bearer <token>'

The request-and-validation pattern separates the documented request from response handling that must follow the endpoint contract:

  1. Your integration selects the documented GET operation.
  2. Your configuration supplies the Scribe API base URL, the /v1/analytics/views path, and a valid bearer token without placing the token in source code or logs.
  3. The client sends the HTTPS request.
  4. The client records the HTTP status and parses the JSON response only when the returned status and body match the documented contract.
  5. Your application maps the supported response fields to its own analytics model.

The command above shows the documented request; response mapping follows the current endpoint contract. Use the public OpenAPI specification to establish the response schema and supported parameters before you write the mapping layer. That keeps the useful part of the pattern - the method, URL, authentication, and data flow - separate from assumptions about fields that may change.

Use the sample command as a request skeleton, not as a complete production configuration. Replace the token placeholder through your runtime's protected secret handling, and keep any endpoint parameters in a separate configuration layer until the documentation confirms their names, types, and allowed values. The example deliberately leaves the response mapping open because the supported schema belongs to the endpoint contract.

Before you adapt the command, write down four decisions:

  • which analytics result your receiving system needs;
  • which documented endpoint provides that result;
  • which response properties your application will retain;
  • which status and error conditions stop processing or trigger a controlled retry.

This short record makes an assumption visible before it becomes code. If you cannot point to a documented endpoint property for a required output, pause the mapping work. Choose a documented interface that exposes the needed representation or revise the receiving-system requirement instead of filling the gap with a guessed field.

Verify the current contract before mapping fields

Our documented aggregated event analytics request is GET https://api.scribe-mail.com/v1/analytics/events/summary, using the same Authorization: Bearer <token> format. You can use it as a second pattern when your workflow needs aggregated event analytics rather than signature-view analytics. The endpoint choice does not determine the complete implementation, however. Check the current endpoint documentation and public OpenAPI specification for supported parameters and response schemas before mapping fields.

Before implementing either analytics request, verify:

  • the exact endpoint path and HTTP method;
  • required and optional parameters, including their types and allowed values;
  • authentication requirements and the scope needed for the operation;
  • response properties, data types, nesting, and whether a response can be empty;
  • documented status codes, limits, pagination, and other endpoint behavior.

A response model should be built from those details. If your receiving system requires a field that the documented response does not expose, stop at that boundary and choose another documented interface or change the receiving-system requirement.

Use the current public OpenAPI specification to verify endpoint paths, methods, parameters, schemas, and responses. Use the official webhook documentation to verify event names, payloads, signing, delivery, and retry behavior when you choose event delivery instead of retrieval. An endpoint example is not a substitute for checking the complete API contract your workflow needs.

Keep validation behavior tied to the API whose response you are handling. For the FlexFactor API, a 400 response means validation failed; parse the errors object for field-level details. For Scribe, use the documented JSON error envelope and status meanings described in the validation section of this guide. This separation prevents a familiar field name or error shape from becoming an unsupported implementation assumption.

Create a field-mapping record before you write the adapter. For every value your receiving system needs, record the source endpoint, the documented response property, the expected data type, whether the value may be absent, and the action to take when validation fails. Keep the source property name separate from your internal field name so a change in your application model does not hide a change in the API contract.

A useful mapping record answers these questions:

  • What business or operational decision uses the value?
  • Which documented response property supplies it?
  • What indicates a valid response for this operation?
  • What should happen when the property is missing or has an unexpected type?
  • Which status or error condition prevents the mapping from running?

This record also makes review more precise. You can compare each mapping with the current public OpenAPI specification rather than reviewing a large parser as one block. Recheck the record whenever the endpoint, parameters, response schema, authentication requirement, or documented behavior changes.

Choose retrieval or event delivery

Choose the Scribe REST API when your system owns the timing of a documented request and needs to work with JSON over HTTPS. A scheduled job, an operator-triggered action, or an application workflow can request the data at a deliberate point, then decide how to process the returned representation. The important fit question is whether your system needs to ask for a known resource or operation at a time it controls.

Start with retrieval when the workflow needs a snapshot, a report, or a response to a user action. Write down the endpoint, the reason for the request, and the data your application must receive. Then map only the documented fields. If the endpoint contract cannot supply the data or timing your workflow requires, do not fill the gap with an assumed parameter or an undocumented path.

Choose webhooks when your system should receive documented signature events instead of polling the API. Our webhooks push events to your systems, so the event producer initiates delivery and your endpoint reacts when a supported event occurs. Documented examples include conversions, visitor identification, signature publication or installation failure, teammate changes, campaign-state changes, and integration access changes.

Use this decision rule:

  • Request data: Choose the REST API when your application needs to control when it asks for a documented resource.
  • Receive a change: Choose webhooks when your application needs to react to a documented event delivered to its endpoint.
  • Need both: Use each interface for its distinct job only after checking the separate API and webhook contracts.

Do not infer that every API resource has a matching webhook event, or that every webhook event has a matching analytics endpoint. Confirm the supported interface for the workflow you are implementing.

Handle webhook input and delivery behavior

A Scribe webhook delivery is an HTTP POST with a JSON body. The type field identifies the event, and the remaining payload is event-specific. The delivery is signed; the webhook documentation describes the signing scheme and the event-specific payloads. Your receiver should therefore treat the HTTP method, signature, event type, and payload as separate checks rather than accepting a body based only on its apparent shape.

A practical receiver flow is:

  1. Accept the HTTPS POST at the configured endpoint.
  2. Verify the signature using the documented signing procedure before trusting the payload.
  3. Read type and route the event to the handler for that documented event.
  4. Validate the event-specific fields your handler actually needs.
  5. Use the stable svix-id value to deduplicate retries of the same delivery.
  6. Record the outcome your operations process needs.

The event catalog and webhook documentation define the names, payloads, signing, delivery, and retry behavior. Keep your handler aligned with those documents rather than creating a general parser that assumes every event has the same fields.

Webhook delivery is at-least-once, so the same message can arrive more than once. Handle deliveries idempotently and use the stable svix-id header to deduplicate retries of the same message. This is a processing requirement: your handler should be able to see a repeated delivery without applying the same business action twice.

Failed deliveries are retried automatically with exponential backoff over roughly a day, and an endpoint that keeps failing is eventually disabled. Build monitoring around the endpoint's health and inspect failed deliveries through the documented operational path. Do not assume that a single successful request proves the receiver will remain available.

When sequence matters, use the payload's occurred_at value rather than the order in which your server receives messages. That gives your application an event timestamp to evaluate when it decides whether a later delivery should update or wait behind another event. It does not remove the need for idempotent processing.

Adapt the webhook pattern to your stack by isolating the delivery adapter from your application logic. The adapter should verify the signed request, preserve the event identifier and occurrence time, and pass a validated event object to the handler. The handler should then decide what your system does with that particular event. This division keeps signature verification and duplicate detection from being scattered across multiple business handlers.

Use the documented event name and payload fields as the adapter's contract. If your workflow needs a field that is not present for the selected event, choose a different documented event or use a documented REST request for the data instead. If event ordering is material to the result, store enough event metadata to compare occurred_at values. If your endpoint repeatedly fails, resolve the delivery problem before treating the integration as operational.

Infographic showing six ordered webhook receiver steps: accept the HTTPS POST, verify the signature, read the event type, validate needed fields, deduplicate retries with svix-id, and record the outcome.
Separate delivery verification, event validation, and application handling.

Set authentication and scope deliberately

Authenticate Scribe API requests with a workspace API key sent as a Bearer token in the Authorization header. The header belongs in the request configuration, while the key belongs in a protected secret store appropriate to your runtime. Keep the token out of committed code, sample responses, debug output, and URLs. A request that reaches the correct endpoint without valid authentication is still an unsuccessful integration test.

Test authentication separately from field mapping. First confirm that the client is sending the expected header format. Then send the narrowest documented request that exercises the intended operation. Record the returned status and error body without exposing the key. If the request succeeds, continue to response validation; if it fails with an authentication status, correct the key configuration before changing the endpoint or response parser.

Grant a Scribe key only the scopes the integration needs. A request outside the key's scopes returns 403, and a signatures-only reporting script needs signatures:read and nothing else. Start with the smallest scope set that supports the documented operation, then add a scope only when a specific documented request requires it. This keeps the permission decision connected to the resource being used rather than to a broad guess about future features.

Treat an API key like a password. Anyone who has it can act as the member who created it within that member's scopes. If the key is exposed, delete it from the dashboard and create a new one, then update the protected configuration and retest authentication. Do not solve an authorization failure by granting every available scope; first determine whether the request is using the correct key, endpoint, and documented permission.

Comparison infographic contrasting authentication and scope checks. Authentication uses a Bearer token in the Authorization header, while scope control grants only needed scopes and identifies 403 access failures.
Test identity separately from permission, then keep the scope set minimal.

Validate responses and failure paths

Our API uses conventional HTTP status codes and a consistent JSON error envelope across endpoints. Treat the status code as part of the response contract, not as an incidental number. For the Scribe API, 200 OK indicates success, 201 Created indicates that a resource was created, and 204 No Content indicates success without a response body.

For a documented GET analytics request, begin the success check with the status your endpoint contract specifies, then verify the body before mapping it. Your client should distinguish a successful response with JSON from a successful response with no content. It should also surface malformed or unexpected data instead of silently converting it into an empty result. The exact response fields, required properties, and permitted empty states come from the current endpoint documentation.

Use the returned status to choose the next diagnostic step:

  • 401: The API key is missing or invalid. Check the bearer-token configuration and the secret supplied to the runtime.
  • 403: The key lacks the required scope, or the feature is unavailable on the plan. Check the key's scopes and the endpoint's documented access conditions.
  • 404: The resource does not exist or belongs to another workspace. Check the URL, identifier, and workspace context.
  • 409: The request conflicts with the current state. Resolve that state before repeating an operation that depends on it.
  • 422: The request was understood but failed validation. Inspect the details array to identify invalid fields.

Treat non-2xx responses as failures. Read error.type and error.code, inspect details for 422, check the key and scopes for 401 and 403, and resolve the conflicting state for 409. A retry should follow the documented cause, not happen automatically for every failure.

Run the request through a repeatable validation sequence:

  1. Configuration: Confirm the base URL, versioned path, method, and protected token source.
  2. Authentication: Confirm that the Authorization header is present and uses the documented bearer format.
  3. Permission: Confirm that the key has the narrow scope required by the endpoint.
  4. Transport: Record the status code and confirm that the response arrived from the intended endpoint.
  5. Schema: Parse JSON only when the response contract allows a body, then validate the fields and types your mapping uses.
  6. Error handling: Exercise an invalid or unauthorized test condition in a controlled environment and confirm that your client records the documented error structure.
  7. Integration behavior: Check how your receiving system stores, displays, or forwards the mapped result.

Before implementing, verify endpoint paths, methods, parameters, authentication requirements, response schemas, limits, and behaviors in the current API specifications. This sequence tests the connection as a contract rather than treating one successful call as proof that the whole workflow is ready.

Keep the validation record close to the request you are testing. Capture the request version, endpoint, method, scope, returned status, body-validation result, and mapped output. For a failed request, record the error type and code, the relevant details, and the corrective action. Do not store the bearer token in the record.

Separate transport success from application acceptance. A 200 response may still require schema validation before your receiving system accepts it, while a documented empty success may be valid for an operation that returns no body. Likewise, an error response should lead to a defined diagnostic path rather than an empty value that looks like valid data.

Repeat the check after changing the endpoint, parameters, key scopes, response mapping, or webhook handler. The goal is a traceable decision about whether the integration behavior matches the documented contract, not merely a screenshot of one successful call.

Horizontal bar chart of Scribe response status codes and meanings: 200 success, 201 created, 204 no content, 401 authentication failure, 403 access failure, 404 missing resource, 409 state conflict, and 422 validation failure.
Map each returned status to a defined validation or diagnostic path.

Test the integration beyond one successful request

A single successful request checks one path through the system, so broader testing is needed for the conditions that matter to the integration. A broader practical test uses 3 representative integrations, identical list, get, and create operations, and 50+ concurrent accounts to expose degradation and rate-limit recovery. Use that structure as a test-design reference when the integration will serve multiple accounts or repeat operations at scale; adapt the operations to the capabilities your documented Scribe workflow actually uses.

Choose representative cases rather than three copies of the easiest case. Vary the account or workspace conditions that your integration is expected to handle, while keeping the operation list consistent enough to compare results. For each case, record the request status, response parsing result, error behavior, elapsed processing path, and final state in the receiving system. For concurrent testing, record whether the client handles throttling or other documented limits without losing or duplicating work.

Use an acceptance record with these fields:

  • test case and account condition;
  • operation and documented endpoint;
  • authentication and scope configuration;
  • expected status and response condition;
  • actual status, response validation result, and mapped output;
  • error or retry behavior when the request fails;
  • duplicate or ordering result for webhook tests;
  • concurrency condition and recovery result;
  • unresolved contract questions and their owner.

The record is a practical aid for comparing runs and locating a failure. Review the integration against the documented request, response, error, and delivery checks for the cases that matter to your workflow.

Plan the work around its dependencies

Use 2 to 6 weeks as a general planning range for an API integration, not as a Scribe-specific delivery promise. The estimate describes API integrations in practice, and the biggest time factor is often how quickly content, access, and decisions come from your side rather than the implementation itself. A small request experiment can take less time; a production connection with testing, permissions, monitoring, and receiving-system changes can require more work.

Treat the range as a planning question, not a deadline. The calendar depends on the endpoint contract, the number of operations, the authentication and scope decisions, the receiving system, test environments, and the people who must approve the behavior. Separate the time needed to prove the request from the time needed to make the integration dependable.

Reduce avoidable waiting by preparing the dependencies before implementation:

  • select the documented Scribe endpoint or webhook event;
  • identify the fields your receiving system actually needs;
  • establish who can create and rotate the workspace key;
  • define the minimum scope for the operation;
  • prepare a test workspace or controlled test conditions;
  • agree on the success, error, duplicate, and ordering behavior;
  • assign decisions about field mapping and retry handling;
  • reserve time for representative and concurrent testing.

This plan turns the request pattern into work that can be estimated. It also gives you a clear boundary: if access, contract details, or a receiving-system decision is unresolved, the implementation schedule is not ready for a precise promise.

A timeline for API integration planning shows interface selection, defining required fields and scope, preparing tests, and a 2-6 weeks planning range. The final item frames the range as a guide rather than a promise.
Resolve access, contract, and decision dependencies before promising a schedule.

Recognize when the example no longer fits

Stop adapting the request pattern when the documented contract does not match the data or timing your workflow requires. A REST integration fits when the required data is exposed through a resource contract that your receiving system can request, interpret, and process. If the required field, operation, parameter, response shape, or event is not documented for the interface you selected, do not manufacture a workaround from a similar endpoint name.

Use these boundaries to decide what to do next:

  • Missing data: Recheck the documented resources and analytics or event interfaces; change the workflow requirement if no supported representation meets it.
  • Unresolved authentication: Correct the bearer-token configuration before changing application logic.
  • Insufficient access: Review the minimum required scope and the endpoint's access conditions before requesting broader permissions.
  • Invalid response: Compare the request and parser with the current schema before adding fallback fields.
  • Repeated delivery failure: Inspect signature verification, endpoint availability, response handling, and duplicate processing before relying on webhooks.
  • Ordering-sensitive behavior: Use occurred_at when the documented webhook payload provides it, and do not rely on arrival order.

Change interfaces when the timing model is wrong. If your application needs to ask for a documented result at a chosen time, keep the REST request. If it needs to react to a documented event, evaluate webhooks rather than building a polling loop around an assumption. If neither interface supplies the required data or behavior, pause the implementation and define the gap before writing more code.

The same boundary applies when your stack is an AI agent, a command-line process, or an operations service. The receiving system still needs a documented method, authentication model, input or event shape, output representation, and failure path. Adapt the client around that contract. Do not describe an undocumented endpoint, response field, event name, retry rule, or integration outcome as if it were part of the supported interface.

Continue with the official integration documentation

A safe integration starts with a small, documented request and ends with validation of the response, permissions, errors, and operating behavior. Use the method, URL, authentication header, response contract, and failure states as one connected design. When your workflow is event-driven, apply the same discipline to signature verification, event types, duplicate delivery, retries, and ordering.

We provide structured JSON through our CLI and real-time events through webhooks. Choose the interface whose documented contract matches the way your system needs to obtain or receive signature data. A qualified professional should decide whether the documented interface and its conditions are suitable for your specific production environment.

API documentation

Webhook documentation

CLI documentation

Use the interface-specific contract to adapt the request pattern to your stack, then validate the implementation with the sequence above before relying on its output.

Get started with Scribe

Let AI build your signature — from a screenshot

Free 14-day trial — no credit card.

Keep reading

AI, API & IntegrationsNov 27, 202619 min read

MCP Server Marketplace: How to Vet a Server

Learn how to find, compare, and validate MCP servers by checking listings, runtime behavior, access scope, cost, and workflow fit.

AI, API & IntegrationsNov 27, 202614 min read

Claude MCP Login: Connect Scribe with OAuth

Learn how Claude MCP login connects Scribe through OAuth, how to verify the official connector, and when to stop before authorizing.

AI, API & IntegrationsNov 27, 202616 min read

REST API Sample: Build and Verify a Scribe Integration

Learn how to read a REST API sample, verify Scribe endpoints, and test a documented integration before implementation.

Stripe email signature – Patrick Collison
Notion email signature – Camille Ricketts

Start your 14-day
free trial

Join 10,000+ companies using Scribe to power 15 million daily brand impressions

No card required. All features. Unlimited users.

Nike email signature – Greg Hoffman
Headspace email signature – Andy Puddicombe