Skip to main content
POST
/
object-storage
/
{id}
/
cors-policies
Create CORS policy
curl --request POST \
  --url https://api.sevalla.com/v3/object-storage/{id}/cors-policies \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "methods": [
    "GET",
    "PUT"
  ],
  "origins": [
    "https://example.com"
  ],
  "headers": [
    "Content-Type"
  ]
}
'
{
  "message": "CORS policy created"
}

Authorizations

Authorization
string
header
required

API key authentication. Pass your API key as a Bearer token in the Authorization header.

Path Parameters

id
string<uuid>
required

Object storage bucket identifier

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Example:

"fb5e5168-4281-4bec-94c5-0d1584e9e657"

Body

application/json
methods
enum<string>[]
required

HTTP methods allowed by this CORS rule. At least one method is required. GET - read objects. PUT - upload objects. POST - create objects. DELETE - remove objects. HEAD - retrieve object metadata.

Minimum array length: 1
Available options:
GET,
PUT,
POST,
DELETE,
HEAD
Example:
["GET", "PUT"]
origins
string[]
required

Origins allowed by this CORS rule. Use "*" to allow all origins. Maximum 100 origins.

Required array length: 1 - 100 elements
Required string length: 1 - 250
Example:
["https://example.com"]
headers
string[]

HTTP headers allowed in CORS requests. Maximum 100 headers.

Maximum array length: 100
Required string length: 1 - 250
Example:
["Content-Type"]

Response

Default Response

message
string
required

Confirmation message

Example:

"CORS policy created"