API Node

vellum.workflows.nodes.APINode

Used to make HTTP requests to external APIs.

Attributes

url
strRequired

The URL to send the request to.

method
APIRequestMethodRequired

The HTTP method to use for the request.

headers
Optional[Dict[str, Union[str, VellumSecret]]]

The headers to send in the request.

data
Optional[str]

The data to send in the request body.

json
Optional[JsonObject]

The JSON data to send in the request body.

authorization_type
Optional[AuthorizationType]

The type of authorization to use for the API call.

api_key_header_key
Optional[str]

The header key to use for the API key authorization.

bearer_token_value
Optional[str]

The bearer token value to use for the bearer token authorization.

timeout
Optional[int]

The maximum number of seconds to wait for the API request to complete. If not specified, the request will use the default timeout behavior.

Outputs

status_code
int

The HTTP status code of the response

headers
Dict[str, str]

The response headers

text
str

The raw text response body

json
Optional[Dict[str, Any]]

The parsed JSON response body (if the response is JSON)