Get the organization avatar upload URL
Returns where to upload the organization avatar. Request: POST /v1/organizations/current/avatar-upload. Scope: organization:update.
POST
Returns where to upload the organization avatar. PUT the png, jpeg, or webp bytes (at most maxBytes) to uploadUrl with the same credential and a matching Content-Type; the response is { src }. Then send PATCH /v1/organizations/current with { avatarUrl: src }.
apiKeyheader
x-api-key<token>Success
application/json- response
uploadUrl*stringThe URL to PUT the image bytes to.
maxBytes*numberThe largest image the upload accepts, in bytes.
contentTypes*array<string>The image content types the upload accepts.
import { createClient } from "samva";
const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });
const result = await samva.organizations.createAvatarUpload({});Example Response
{
"uploadUrl": "string",
"maxBytes": 0,
"contentTypes": [
"string"
]
}