Skip to main content
POST
/
api
/
v1
/
profiles
/
{profile_id}
/
leaves
Create a leave for a profile
curl --request POST \
  --url https://api.scholarlysoftware.com/api/v1/profiles/{profile_id}/leaves \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/vnd.api+json' \
  --data '
{
  "data": {
    "type": "leave",
    "attributes": {
      "effective_from": "2023-12-25",
      "custom_fields": {},
      "name": "<string>",
      "external_id": "<string>",
      "leave_type": "<string>",
      "effective_to": "2023-12-25",
      "fte_percentage": 123,
      "show_on_dashboard": true,
      "note": "<string>"
    },
    "relationships": {}
  }
}
'
import requests

url = "https://api.scholarlysoftware.com/api/v1/profiles/{profile_id}/leaves"

payload = { "data": {
"type": "leave",
"attributes": {
"effective_from": "2023-12-25",
"custom_fields": {},
"name": "<string>",
"external_id": "<string>",
"leave_type": "<string>",
"effective_to": "2023-12-25",
"fte_percentage": 123,
"show_on_dashboard": True,
"note": "<string>"
},
"relationships": {}
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/vnd.api+json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
data: {
type: 'leave',
attributes: {
effective_from: '2023-12-25',
custom_fields: {},
name: '<string>',
external_id: '<string>',
leave_type: '<string>',
effective_to: '2023-12-25',
fte_percentage: 123,
show_on_dashboard: true,
note: '<string>'
},
relationships: {}
}
})
};

fetch('https://api.scholarlysoftware.com/api/v1/profiles/{profile_id}/leaves', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
{
  "data": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "type": "leave",
    "attributes": {
      "created_at": "<string>",
      "updated_at": "<string>",
      "custom_fields": {},
      "is_current": true,
      "name": "<string>",
      "external_id": "<string>",
      "leave_type": "<string>",
      "effective_from": "2023-12-25",
      "effective_to": "2023-12-25",
      "fte_percentage": 123,
      "show_on_dashboard": true,
      "note": "<string>"
    },
    "relationships": {
      "profile": {
        "links": {
          "related": "<string>"
        },
        "meta": {},
        "data": {
          "type": "profile",
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
        }
      }
    }
  }
}
{
"errors": [
{
"status": "<string>",
"title": "<string>",
"detail": "<string>"
}
]
}
{
"errors": [
{
"status": "<string>",
"title": "<string>",
"detail": "<string>"
}
]
}
{
"errors": [
{
"status": "422",
"title": "Validation Error",
"detail": "Label can't be blank"
}
]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Authorization
string
required

Bearer token

Path Parameters

profile_id
string
required

Body

application/vnd.api+json
data
object
required

Response

leave created

data
object
required