• Custom Data/
    Custom Data (Flows) API/
    Update an Entry

    Update an Entry

    PUT Update an entry

    https://api.moltin.com/v2/flows/:slug/entries/:id
    

    Parameters

    Path parameters

    NameRequiredTypeDescription
    slugRequiredstringThe slug for the Flow you are requesting an entry for.
    idRequiredstringThe ID of the entry you are updating.

    Headers

    NameRequiredTypeDescription
    AuthorizationRequiredstringThe Bearer token required to get access to the API.

    Body

    NameRequiredTypeDescription
    typeRequiredstringThis is always entry.
    :fieldSlugRequiredstringThe field slug for each field in this flow along with the corresponding value for this entry.
    entryIDRequiredstringThe ID of the entry.

    You can have multiple {FIELD_SLUG}values in the request body if they are related to the flow.

    Request Examples

    Curl

    curl -X PUT https://api.moltin.com/v2/flows/:flowSlug/entries/:entryId \
         -H "Authorization: XXXX" \
         -H "Content-Type: application/json" \
         -d $'{
           "data": {
             "id": "{ENTRY_ID}",
             "type": "entry",
             "{FIELD_SLUG}": "a new value",
           }
         }'
    

    JavaScript SDK

    cconst flowSlug = "flow-slug";
    const entryId = "25617d3e-14a6-434c-bfab-3fda87517aaf";
    
    
    const data = {
      "{FIELD_SLUG}": "A new value",
    };
    
    
    // Where `EPCC` is an authenticated client
    await EPCC.Flows.UpdateEntry(flowSlug, entryId, data);
    

    Response Example

    200 OK

    {
        "data": {
            "id": "03224af8-da41-4761-99fb-a125fa81ed99",
            "type": "entry",
            "brand-image": "a new image",
            "meta": {
                "timestamps": {
                    "created_at": "2018-06-06T14:42:39.312Z",
                    "updated_at": "2018-06-06T14:42:39.312Z"
                }
            },
            "links": {
                "self": "https://api.moltin.com/v2/flows/brands/entries/03224af8-da41-4761-99fb-a125fa81ed99"
            }
        }
    }
    

    Was this helpful?

    Previous
    Create an Entry