Change availability to date

For commercial need - we want to update the availability date for each team member on a certain date
(basically we release next weeks schedule on friday afternoons)
It looks like there is a rest endpoint - but i am struggling with holes in the documentation
1 - where do i get a personal token - its not where the documentation says it should be
2 - what the call? I see a a patch /{shop}/team-members/{id}

but its not clear what the {id} is i would assume a team member (resource id) but the documentation says use an admin id can i just send this

{

“id“: “teammember_id?”,
“availabilityRange”: {
“availableTo”: {
“type”: “EXACT_DATE”,
“value”: {“20-12-2025”}
}
},
}

thanks

Matt

Hi Matthew_Justin_Lovel

You can get your Personal Access Token (PAT) from the Sesami Admin Portal. Please check this link for details:
:backhand_index_pointing_right: https://sesami.dev/docs/sesami-api/personal-access-token/

Please note that the team-member API is deprecated — you should now use the Resource API, which is available in our Sesami Swagger:
:backhand_index_pointing_right: https://api.sesami.co/swagger

To find your resource ID, you can:

  • List all resources:
    GET /{sesami-shop-id}/resources

  • Update a resource:
    PATCH /{sesami-shop-id}/resources/{resource-id}

:warning: Note: Your Sesami Shop ID is the same as your Admin ID, which you can find in the Sesami Admin Portal. For more details, please check:
:backhand_index_pointing_right: https://sesami.dev/docs/sesami-api/intro/

1 Like

Hi

You can get your Personal Access Token (PAT) from the Sesami Admin Portal. Please check this link for details:
:backhand_index_pointing_right:https://sesami.dev/docs/sesami-api/personal-access-token/

this doesnt work - i get bounced to dashboard.

there is no section called token

| Elias_Mohammadi
August 20 |

  • | - |

Hi Matthew_Justin_Lovel

You can get your Personal Access Token (PAT) from the Sesami Admin Portal. Please check this link for details:
:backhand_index_pointing_right:https://sesami.dev/docs/sesami-api/personal-access-token/

Please note that the team-member API is deprecated — you should now use the Resource API, which is available in our Sesami Swagger:
:backhand_index_pointing_right:https://api.sesami.co/swagger

To find your resource ID, you can:

  • List all resources:
    GET /{sesami-shop-id}/resources

  • Update a resource:
    PATCH /{sesami-shop-id}/resources/{resource-id}

:warning:Note: Your Sesami Shop ID is the same as your Admin ID, which you can find in the Sesami Admin Portal. For more details, please check:
:backhand_index_pointing_right:https://sesami.dev/docs/sesami-api/intro/

Matthew_Justin_Lovel, This is an example of how to update a resource’s availabilities

availabilities: The working days and hours of resources.
availabilitiesRange: The valid date range for availabilities. For example, if set from 2025-12-01 to 2025-12-03, resources can only be booked within that period.
timezone: The timezone in which the availabilities are stored. For example, 11:00 in Europe/Paris.

curl -X PATCH 'https://api.sesami.co/api/v1/{SESAMI_SHOP_ID}/resources/{resourceID}' \
--header 'x-shop-id: SESAMI'_SHOP_ID \
--header 'x-client-id: YOUR'_CLIENT_ID \
--header 'x-api-key: YOU'R_TOKEN \
--header 'Content-Type: application/json' \
--data '{
  "availabilities": [
    {
      "type":"wday",
      "date": null,
      "weekday":"thursday",
      "intervals": [
        {
          "from":"10:00",
          "to":"11:00"
        }, {
          "from": "12:00",
          "to": "13:00"
        }
      ]
    }
  ],
  "availabilitiesRange": {
    "availableFrom": {
      "type": "DAYS_INTO_THE_FUTURE",
      "value":10
    }, 
    "availableTo": {
      "type": "EXACT_DATE",
      "value":"2026-03-03"
    }
  }
  "timezone":"Europe/Paris"
}'

Note: EXACT_DATE format is yyyy-MM-dd.e.g. 2026-01-02
Note: you can also create availabilities for specific date.

"availabilities": [
    {
      "type":"date",
      "date": "2025-12-08,
      "weekday":null,
      "intervals": [
        {
          "from":"10:00",
          "to":"11:00"
        }, {
          "from": "12:00",
          "to": "13:00"
        }
      ]
    }
  ]

You can also use these variables for the availableFrom:

{type: NOW, value:0}
{type: DAAYS_INTO_THE_FUTURE, value: positive number},
{type: EXACT_DATE, value: 'yyyy-MM-dd'}

And For availableTo:

{type: INDEFINITELY, value:0}
{type: DAAYS_INTO_THE_FUTURE, value: positive number},
{type: EXACT_DATE, value: 'yyyy-MM-dd'}
1 Like

sending this payload with correct headers

{ “availabilityRange”: { “availableTo”: { “type”: “EXACT_DATE”, “value”: “2025-08-27” } } }

results in a 200 success response with expected json
{“id”:“689d876092bc8a5725f5182e”,“name”:“Louise Carmen PGC 1”,“type”:“68a2c5e666a57587bb6c7320”,“email”:“hello@louisecarmen.com”,“status”:true,“image”:{“id”:null,“path”:“https://cdn.sesami.co/default_avatar.png”},“shopId”:“xxx”,“description”:null,“eventDescription”:null,“mobile”:null,“notificationEmailStatus”:false,“metaFields”:{}}

but it makes no actual change

any ideas why?

we are ONLY changing the TO date as explained in original post.

just to be clear this is the php curl

curl_setopt_array($ch, [
CURLOPT_URL => $url,
CURLOPT_CUSTOMREQUEST => ‘PATCH’,
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'x-shop-id: ’ . $sesamiShopId,
'x-client-id: ’ . $client_id,
'x-api-key: ’ . $token,
‘Content-Type: application/json’,
],
CURLOPT_TIMEOUT => 30,
]);
where url is:
$url = "$baseUrl/$sesamiShopId/resources/$resourceI

The issue is with the property name: it should be availabilitiesRange (you used availabilityRange).

Also, you must send availableFrom even if you don’t want to change it (send the current value). So, the correct payload looks like this:

{
    "availabilitiesRange": {
        "availableFrom": {
            "type":"NOW",
            "value":0
        },
        "availableTo": {
            "type": "EXACT_DATE",
            "value":"2025-08-27"
        }
    }
}

thank you! thats perfect!