Skip to content

    v2PatchBrandsBrandId

    Update brand details, schedules or connections. To rename a brand, send section brand, action update and the revision you last read.

    See the REST reference for PATCH /v2/brands/{brand_id}.

    Signature

    v2PatchBrandsBrandId(
      brand_id: string,
      body: Record<string, unknown>,
      options?: {
        signal?: AbortSignal;
        website?: string | null;
        idempotencyKey?: string;
        ifMatch?: string | number;
        hubspotAccessToken?: string;
      },
    ): Promise<ApiResponse<unknown>>

    Parameters

    brand_id
    ID of the brand that owns the record.
    body
    JSON object for this action. The example includes the fields for brand.
    options
    Pass the named options in the signature. The selected action or view determines which fields are required.
    options.signal
    Optional AbortSignal to cancel the HTTP request.
    options.idempotencyKey
    The SDK generates a request key when you omit it. Pass the same key and body to retry this write in a separate call.
    options.ifMatch
    Pass the current revision as a number or quoted ETag.

    Return value

    Promise<ApiResponse<unknown>>. A successful rename returns the updated brand in body.data, including its name and revision.

    Errors

    • The SDK throws AeoApiError if the API returns an error. Inspect status, code, fieldErrors and requestId.
    • AeoTransportError means the request failed to connect or the client could not finish reading a successful response. Invalid JSON in a successful response throws SyntaxError. If you abort the request, the SDK throws the reason from the AbortSignal.
    • For HTTP 422, check fieldErrors for the input field and validation message.
    • A missing or invalid ifMatch raises Error before the request. Read the current revision before retrying a rejected update.

    TypeScript example

    import { AeoClient } from "@aeoapi/aeo-sdk";
    
    const apiKey = process.env.AEO_API_KEY;
    if (!apiKey) throw new Error("Set AEO_API_KEY on your server.");
    const client = new AeoClient(apiKey, { baseUrl: "https://api.aeoapi.dev" });
    
    // Replace 3 with the current brand revision.
    // Substitute your own record IDs and values.
    const body = {
      "action": "update",
      "name": "Example Plumbing",
      "section": "brand"
    };
    const response = await client.v2PatchBrandsBrandId("00000000-0000-4000-8000-000000000001", body, {
      "ifMatch": 3
    });
    console.log(response.status, response.body);

    Requests by feature

    Brands, locations and connections

    Content drafts and editorial generation

    See TypeScript client setup for authentication, timeouts and retry settings.