Skip to main content

Freeday API (v1.0)

Download OpenAPI specification:Download

Authentication

Gets current authentication information

Authorizations:
BearerToken

Responses

Response samples

Content type
application/json
{
  • "userId": "5c37cf93b24a96f47a29bec",
  • "limit": "2018-09-28T15:35:49.828Z",
  • "token": "Ep2uHmVctSupD5z2yCXa"
}

Authenticates user with username and password

Authorizations:
BearerToken
Request Body schema: application/json
username
string

User name

password
string

User password

Responses

Request samples

Content type
application/json
{
  • "username": "lucie.bronze",
  • "password": "password123"
}

Response samples

Content type
application/json
{
  • "userId": "5c37cf93b24a96f47a29bec",
  • "limit": "2018-09-28T15:35:49.828Z",
  • "token": "Ep2uHmVctSupD5z2yCXa"
}

Revokes current authentication token

Authorizations:
BearerToken

Responses

Response samples

Content type
application/json
{ }

Checks the validity of a welcome secret code

Welcome secret code must be provided in the Authorization header

Authorizations:
BearerToken

Responses

Response samples

Content type
application/json
{ }

Creates the first user using the welcome secret code

Welcome secret code must be provided in the Authorization header

Authorizations:
BearerToken
Request Body schema: application/json
username
required
string >= 6 characters

User name

language
string <country-code>

User language

theme
string
Enum: "light" "dark"

User theme

password
required
string >= 6 characters
Default: "en"

User password

Responses

Request samples

Content type
application/json
{
  • "username": "lucie.bronze",
  • "language": "en",
  • "theme": "dark",
  • "password": "password123"
}

Response samples

Content type
application/json
{
  • "id": "5c37cf93b24a96f47a29bec",
  • "username": "lucie.bronze",
  • "language": "en",
  • "theme": "dark"
}

Deletes self user and all tokens then generates initialization/welcome data and return secret code

  • This endpoint is available only in test mode
  • It can be used to test the welcome course
  • Self user must be the only one in database
Authorizations:
BearerToken

Responses

Response samples

Content type
application/json
{
  • "secret": "ajdVTPRWQwY3S0RUNX3SDtWcRwWbZUMGbm9NQWlF0Jg"
}

Users

Gets the list of users

Authorizations:
BearerToken
query Parameters
number or string
limit
number

Responses

Response samples

Content type
application/json
{
  • "users": [
    ],
  • "total": 1,
  • "current": 1
}

Creates a new user

Authorizations:
BearerToken
Request Body schema: application/json
username
required
string >= 6 characters

User name

language
string <country-code>

User language

theme
string
Enum: "light" "dark"

User theme

password
required
string >= 6 characters
Default: "en"

User password

Responses

Request samples

Content type
application/json
{
  • "username": "lucie.bronze",
  • "language": "en",
  • "theme": "dark",
  • "password": "password123"
}

Response samples

Content type
application/json
{
  • "id": "5c37cf93b24a96f47a29bec",
  • "username": "lucie.bronze",
  • "language": "en",
  • "theme": "dark"
}

Gets user information

Authorizations:
BearerToken
path Parameters
userId
required
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "id": "5c37cf93b24a96f47a29bec",
  • "username": "lucie.bronze",
  • "language": "en",
  • "theme": "dark"
}

Edits a new user

Authorizations:
BearerToken
path Parameters
userId
required
string <uuid>
Request Body schema: application/json
username
string >= 6 characters

User name

language
string <country-code>

User language

theme
string
Enum: "light" "dark"

User theme

password
string >= 6 characters
Default: "en"

User password

Responses

Request samples

Content type
application/json
{
  • "username": "lucie.bronze",
  • "language": "en",
  • "theme": "dark",
  • "password": "password123"
}

Response samples

Content type
application/json
{
  • "id": "5c37cf93b24a96f47a29bec",
  • "username": "lucie.bronze",
  • "language": "en",
  • "theme": "dark"
}

Deletes a user

Authorizations:
BearerToken
path Parameters
userId
required
string <uuid>

Responses

Response samples

Content type
application/json
{ }

Slack

Gets Slack OAuth URL

Authorizations:
BearerToken

Responses

Response samples

Registers Slack app with OAuth data returned by Slack

Authorizations:
BearerToken
Request Body schema: application/json
code
required
string

Slack OAuth verification code

state
required
string

Slack OAuth state needed to authenticate OAuth data

Responses

Request samples

Content type
application/json
{
  • "code": "516549849849.65498498469498498",
  • "state": "91d516f51b519a546d5654a6f4b654"
}

Response samples

Content type
application/json
{ }

Gets the list Slack users

  • Calling this method updates the Slack user list in database by synchronizing with Slack API (max. one time per minute)
Authorizations:
BearerToken
query Parameters
deleted
boolean
number or string
limit
number

Responses

Response samples

Content type
application/json
{
  • "slackUsers": [
    ],
  • "total": 1,
  • "current": 1
}

Creates Slack user in database or updates if exists

  • This endpoint is available only in test mode
Authorizations:
BearerToken
Request Body schema: application/json
slackId
required
string <slack-id>

Slack user ID

name
required
string

Slack user name

avatar
required
string <uri>

Slack user avatar URL

locale
string <LCID>

Slack user locale taken from their client preferences

forcedLocale
string <LCID>

Slack user locale that they chose to use with the Freeday bot

deleted
boolean

If user has been deleted on Slack

Responses

Request samples

Content type
application/json
{
  • "slackId": "UGJ7AVX32",
  • "name": "Sam Kerr",
  • "locale": "en",
  • "forcedLocale": "fr",
  • "deleted": false
}

Response samples

Content type
application/json
{
  • "id": "5c37cf93b24a96f47a29bec",
  • "slackId": "UGJ7AVX32",
  • "name": "Sam Kerr",
  • "locale": "en",
  • "forcedLocale": "fr",
  • "deleted": false
}

Gets Slack user information

Authorizations:
BearerToken
path Parameters
slackUserId
required
string <slack-id>

Responses

Response samples

Content type
application/json
{
  • "id": "5c37cf93b24a96f47a29bec",
  • "slackId": "UGJ7AVX32",
  • "name": "Sam Kerr",
  • "locale": "en",
  • "forcedLocale": "fr",
  • "deleted": false
}

Gets the list Slack channels

  • Calling this method updates the Slack channel list in database by synchronizing with Slack API (max. one time per minute)
Authorizations:
BearerToken
query Parameters
memberOnly
boolean
number or string
limit
number

Responses

Response samples

Content type
application/json
{
  • "slackChannels": [
    ],
  • "total": 1,
  • "current": 1
}

Creates Slack channel in database or updates if exists

  • This endpoint is available only in test mode
Authorizations:
BearerToken
Request Body schema: application/json
slackId
required
string <slack-id>

Slack channel ID

name
required
string

Slack channel name

isChannel
boolean

If channel is a public channel

isGroup
boolean

If channel is a private channel

isIm
boolean

If channel is a direct message between two members

isMpIm
boolean

If channel is a direct message between more than two members

isMember
boolean

If bot is a member of the conversation

isPrivate
boolean

If channel is privileged between two or more members

archived
boolean

If channel is archived

Responses

Request samples

Content type
application/json
{
  • "slackId": "C7J5HLC85",
  • "name": "random-channel",
  • "isChannel": false,
  • "isGroup": false,
  • "isIm": false,
  • "isMpIm": false,
  • "isMember": false,
  • "isPrivate": false,
  • "archived": false
}

Response samples

Content type
application/json
{
  • "id": "5c37cf93b24a96f47a29bec",
  • "slackId": "C7J5HLC85",
  • "name": "random-channel",
  • "isChannel": false,
  • "isGroup": false,
  • "isIm": false,
  • "isMpIm": false,
  • "isMember": false,
  • "isPrivate": false,
  • "archived": false
}

Gets Slack channel information

Authorizations:
BearerToken
path Parameters
slackChannelId
required
string <slack-id>

Responses

Response samples

Content type
application/json
{
  • "id": "5c37cf93b24a96f47a29bec",
  • "slackId": "C7J5HLC85",
  • "name": "random-channel",
  • "isChannel": false,
  • "isGroup": false,
  • "isIm": false,
  • "isMpIm": false,
  • "isMember": false,
  • "isPrivate": false,
  • "archived": false
}

Slack events endpoint

Reserved for Slack events and interactivity

Authorizations:
BearerToken

Daysoff

Gets the list of days-off

Authorizations:
BearerToken
query Parameters
start
string <date>
end
string <date>
type
Array of strings <uuid>

e.g. ?type=aaa&type=bbb&type=ccc or ?type[]=aaa&type[]=bbb&type[]=ccc

slackUser
Array of strings <slack-id>

e.g. ?slackUser=aaa&slackUser=bbb or ?slackUser[]=aaa&slackUser[]=bbb

status
string
Enum: "confirmed" "canceled" "pending"
order
string
Enum: "asc" "desc"
number or string
limit
number

Responses

Response samples

Content type
application/json
{
  • "daysoff": [
    ],
  • "total": 1,
  • "current": 1
}

Creates a new dayoff

  • If conflicts with other daysoff are detected an error is thrown
  • This endpoint can be used to create a dayoff for one or multiple users
    • Send a Slack user ID as a string in slackUserId to create a dayoff for one user
    • Send an array of Slack user ID in slackUserId to create a dayoff for multiple users
Authorizations:
BearerToken
Request Body schema: application/json
start
required
string <date>

Start date

end
string <date>
Default: "Same as start date"

End date

startPeriod
string
Default: "am"
Enum: "am" "pm"

Start date period

endPeriod
string
Default: "pm"
Enum: "am" "pm"

End date period

type
required
string <uuid>

Dayoff type ID

comment
string

Comment

force
boolean
Default: false

If true skips conflict detection

required
string or Array of strings

Slack user ID or list of Slack user IDs

Responses

Request samples

Content type
application/json
{
  • "start": "2018-12-23",
  • "end": "2018-12-25",
  • "startPeriod": "am",
  • "endPeriod": "pm",
  • "type": "5edb896d286e1fba4f7047a1",
  • "comment": "Some comment",
  • "force": false,
  • "slackUserId": "UGJ7AVX32"
}

Response samples

Content type
application/json
{
  • "id": "5c37cf93b24a96f47a29bec",
  • "start": "2018-12-23T23:00:00.000Z",
  • "end": "2018-12-25T23:00:00.000Z",
  • "startPeriod": "am",
  • "endPeriod": "pm",
  • "count": 2,
  • "days": [
    ],
  • "type": {
    },
  • "slackUser": {
    },
  • "comment": "Some comment",
  • "confirmed": true,
  • "canceled": false
}

Gets a dayoff

Authorizations:
BearerToken
path Parameters
dayoffId
required
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "id": "5c37cf93b24a96f47a29bec",
  • "start": "2018-12-23T23:00:00.000Z",
  • "end": "2018-12-25T23:00:00.000Z",
  • "startPeriod": "am",
  • "endPeriod": "pm",
  • "count": 2,
  • "days": [
    ],
  • "type": {
    },
  • "slackUser": {
    },
  • "comment": "Some comment",
  • "confirmed": true,
  • "canceled": false
}

Edits a dayoff

  • Dayoff status is reset back to 'pending' any time dayoff is edited
  • If conflicts with other daysoff are detected an error is thrown
Authorizations:
BearerToken
path Parameters
dayoffId
required
string <uuid>
Request Body schema: application/json
start
string <date>

Start date

end
string <date>
Default: "Same as start date"

End date

startPeriod
string
Default: "am"
Enum: "am" "pm"

Start date period

endPeriod
string
Default: "pm"
Enum: "am" "pm"

End date period

type
string <uuid>

Dayoff type ID

comment
string

Comment

force
boolean
Default: false

If true skips conflict detection

Responses

Request samples

Content type
application/json
{
  • "start": "2018-12-23",
  • "end": "2018-12-25",
  • "startPeriod": "am",
  • "endPeriod": "pm",
  • "type": "5edb896d286e1fba4f7047a1",
  • "comment": "Some comment",
  • "force": false
}

Response samples

Content type
application/json
{
  • "id": "5c37cf93b24a96f47a29bec",
  • "start": "2018-12-23T23:00:00.000Z",
  • "end": "2018-12-25T23:00:00.000Z",
  • "startPeriod": "am",
  • "endPeriod": "pm",
  • "count": 2,
  • "days": [
    ],
  • "type": {
    },
  • "slackUser": {
    },
  • "comment": "Some comment",
  • "confirmed": true,
  • "canceled": false
}

Gets the conflits of a dayoff

Authorizations:
BearerToken
path Parameters
dayoffId
required
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "conflicts": [
    ]
}

Sets dayoff status as confirmed

Authorizations:
BearerToken
path Parameters
dayoffId
required
string <uuid>
Request Body schema: application/json
force
boolean
Default: false
  • 'true' will force confirmation (any conflicted dayoff will be canceled)
  • 'false' will throw error if conflicts are detected

Responses

Request samples

Content type
application/json
{
  • "force": false
}

Response samples

Content type
application/json
{
  • "id": "5c37cf93b24a96f47a29bec",
  • "start": "2018-12-23T23:00:00.000Z",
  • "end": "2018-12-25T23:00:00.000Z",
  • "startPeriod": "am",
  • "endPeriod": "pm",
  • "count": 2,
  • "days": [
    ],
  • "type": {
    },
  • "slackUser": {
    },
  • "comment": "Some comment",
  • "confirmed": true,
  • "canceled": false
}

Sets dayoff status as canceled

Authorizations:
BearerToken
path Parameters
dayoffId
required
string <uuid>
Request Body schema: application/json
cancelReason
string

Cancelation reason

Responses

Request samples

Content type
application/json
{
  • "cancelReason": "string"
}

Response samples

Content type
application/json
{
  • "id": "5c37cf93b24a96f47a29bec",
  • "start": "2018-12-23T23:00:00.000Z",
  • "end": "2018-12-25T23:00:00.000Z",
  • "startPeriod": "am",
  • "endPeriod": "pm",
  • "count": 2,
  • "days": [
    ],
  • "type": {
    },
  • "slackUser": {
    },
  • "comment": "Some comment",
  • "confirmed": true,
  • "canceled": false
}

Resets dayoff status

Authorizations:
BearerToken
path Parameters
dayoffId
required
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "id": "5c37cf93b24a96f47a29bec",
  • "start": "2018-12-23T23:00:00.000Z",
  • "end": "2018-12-25T23:00:00.000Z",
  • "startPeriod": "am",
  • "endPeriod": "pm",
  • "count": 2,
  • "days": [
    ],
  • "type": {
    },
  • "slackUser": {
    },
  • "comment": "Some comment",
  • "confirmed": true,
  • "canceled": false
}

Dayoff types

Gets the list of day-off types

Authorizations:
BearerToken
query Parameters
enabled
boolean
displayed
boolean
important
boolean
number or string
limit
number

Responses

Response samples

Content type
application/json
{
  • "dayoffTypes": [
    ],
  • "total": 1,
  • "current": 1
}

Creates a new dayoff type

  • If a dayoff type with same name already exist conflict error will be thrown
Authorizations:
BearerToken
Request Body schema: application/json
name
required
string <= 75, characters

Dayoff type name

emoji
string or null

An emoji representing the dayoff type

enabled
boolean
Default: true

If daysoff can be created with this dayoff type

displayed
boolean
Default: true

f the dayoff type is displayed in filters and forms

important
boolean
Default: false

Daysoff with an important type will be highlighted on front clients

Responses

Request samples

Content type
application/json
{
  • "name": "Sick",
  • "emoji": "no_mouth",
  • "enabled": true,
  • "displayed": true,
  • "important": false
}

Response samples

Content type
application/json
{
  • "id": "5c37cf93b24a96f47a29bec",
  • "name": "Sick",
  • "emoji": "no_mouth",
  • "enabled": true,
  • "displayed": true,
  • "important": false
}

Get a dayoff type

Authorizations:
BearerToken
path Parameters
dayoffTypeId
required
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "id": "5c37cf93b24a96f47a29bec",
  • "name": "Sick",
  • "emoji": "no_mouth",
  • "enabled": true,
  • "displayed": true,
  • "important": false
}

Edit a dayoff type

  • If a dayoff type with same name already exist conflict error will be thrown
  • When a dayoff type is modified all dayoff type data within daysoff are also updated
Authorizations:
BearerToken
path Parameters
dayoffTypeId
required
string <uuid>
Request Body schema: application/json
name
string <= 75, characters

Dayoff type name

emoji
string or null

An emoji representing the dayoff type

enabled
boolean
Default: true

If daysoff can be created with this dayoff type

displayed
boolean
Default: true

f the dayoff type is displayed in filters and forms

important
boolean
Default: false

Daysoff with an important type will be highlighted on front clients

Responses

Request samples

Content type
application/json
{
  • "name": "Sick",
  • "emoji": "no_mouth",
  • "enabled": true,
  • "displayed": true,
  • "important": false
}

Response samples

Content type
application/json
{
  • "id": "5c37cf93b24a96f47a29bec",
  • "name": "Sick",
  • "emoji": "no_mouth",
  • "enabled": true,
  • "displayed": true,
  • "important": false
}

Configuration

Gets current configuration

Authorizations:
BearerToken

Responses

Response samples

Content type
application/json
{
  • "brandingName": "Coddity",
  • "brandingLogo": "data:image/png;base64,A0/b1C2//d3E4f==",
  • "slackReferrer": "UXJOA3X11",
  • "workDays": [
    ]
}

Edit configuration

Authorizations:
BearerToken
Request Body schema: application/json
brandingName
string

Branding name

brandingLogo
string <base64>

Branding logo in base64

slackReferrer
string <slack-id>

Slack referrer user ID

workDays
required
Array of integers[ items [ 0 .. 6 ] ]

List of work days

Responses

Request samples

Content type
application/json
{
  • "brandingName": "Coddity",
  • "brandingLogo": "data:image/png;base64,A0/b1C2//d3E4f==",
  • "slackReferrer": "UXJOA3X11",
  • "workDays": [
    ]
}

Response samples

Content type
application/json
{
  • "brandingName": "Coddity",
  • "brandingLogo": "data:image/png;base64,A0/b1C2//d3E4f==",
  • "slackReferrer": "UXJOA3X11",
  • "workDays": [
    ]
}

Gets current public configuration

Public configuration is exposed for non-authenticated users in order to obtain basic information about the instance

Authorizations:
BearerToken

Responses

Response samples

Content type
application/json
{
  • "brandingName": "Coddity",
  • "brandingLogo": "data:image/png;base64,A0/b1C2//d3E4f=="
}

Jobs

Gets a job's settings

Authorizations:
BearerToken
path Parameters
jobName
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "5c37cf93b24a96f47a29bec",
  • "name": "string",
  • "enabled": true,
  • "dayOfMonth": "*",
  • "hour": "*",
  • "minute": "*"
}

Edit a jobs settings

Authorizations:
BearerToken
path Parameters
jobName
required
string
Request Body schema: application/json
enabled
boolean (enabled)

Defines if the job should be run

dayOfMonth
string (dayOfMonth)

The day of the month during which we want the job to run (supports the cron format)

hour
string (hour)

The hour of the day we want to run this job at

minute
string (minute)

The minute we want to run this job at

Responses

Request samples

Content type
application/json
{
  • "enabled": true,
  • "dayOfMonth": "*",
  • "hour": "*",
  • "minute": "*"
}

Response samples

Content type
application/json
{
  • "id": "5c37cf93b24a96f47a29bec",
  • "name": "string",
  • "enabled": true,
  • "dayOfMonth": "*",
  • "hour": "*",
  • "minute": "*"
}

Misc

Pings the API and returns public informations

Responses

Response samples

Content type
application/json
{
  • "version": "v1.2.3"
}