Invoke the custom HTTP API you defined within your machine definition.

PUT /http-apis/{orgId}/machines/{machineSlug}/{httpApiSlug}

This operation sends the method, headers, and body to the httpApiMapper defined in your machine definition for the provided httpApiSlug.

Your code determines whether to reject the request or to accept it and map it to an event that is sent to the machine instance you specify.

The response is determined by the response mapper that you define.

Path parameters

  • orgId string Required

    The id for your organization.

  • machineSlug string Required

    The slug/name for the machine definition this version is related to.

    Minimum length is 1. Format should match the following pattern: ^[a-zA-Z0-9_-]{1,128}$.

  • httpApiSlug string Required

    The identifier for the HTTP API you want to invoke. This should match an identifier you specify in your httpApiMapper map in your machine definition.

Responses

  • default */*

    The response is fully determined by your httpApiMapper code. If you do not specify a responseMapper, we return { ok: true } on success and { error: 'not found' } or {error: 'internal server error'} on failure.

PUT /http-apis/{orgId}/machines/{machineSlug}/{httpApiSlug}
curl \
 --request PUT 'https://api.statebacked.dev/http-apis/org_uHvZHpF4STWvMg8BKVCUTg/machines/my-machine/{httpApiSlug}'