The Laravel Cloud API and CLI are here. Build pipelines, manage environments, and hand off to AI agents. View the docs →
cURL
curl --request POST \ --url https://cloud.laravel.com/api/environments/{environment}/variables \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "method": "append", "variables": [ { "key": "<string>", "value": "<string>" } ] } '
{ "data": { "id": "<string>", "type": "environments", "links": { "self": { "href": "<string>", "rel": "<string>", "describedby": "<string>", "title": "<string>", "type": "<string>", "hreflang": "<string>", "meta": {} } }, "relationships": {} }, "included": [ { "id": "<string>", "type": "applications", "relationships": {} } ] }
Add environment variables to an environment.
The Bearer Token generated on the Cloud UI.
The environment identifier
When set to 'append', variables are added to the end without checking for duplicates. When set to 'replace', variables with matching keys are updated; otherwise they are added.
append
set
1 - 200
Show child attributes
EnvironmentResource
Was this page helpful?