[▲ Vercel Community](/) · [Categories](/categories) · [Latest](/latest) · [Top](/top) · [Live](/live)

[Help](/c/help/9)

# Problems with Vercel REST API

378 views · 2 likes · 11 posts


Kyaw (@kyswtn) · 2024-09-23

Hello.

I'm building a Vercel integration that uses Vercel REST API. In doing so, I've encountered  a few endpoints that are either not properly documented or not working at all. I’ve managed to find some workarounds by inspecting how the Vercel Dashboard interacts with some of these endpoints. But these hacks are even more imperfect, so I thought I'd ask in hopes of finding proper solutions.

1. Endpoint to [list deployment files](https://vercel.com/docs/rest-api/endpoints/deployments#list-deployment-files) is not working at all, a request to it usually takes about 3 minutes until it eventually responds with `500 Internal Server Error`. As a solution for this, I've started using some endpoints to [vercel.com/api](https://vercel.com/api) instead of [api.vercel.com](https://api.vercel.com). But I’m not sure if that’s allowed or the correct approach.
2. Endpoint to [get deployment file contents](https://vercel.com/docs/rest-api/endpoints/deployments#get-deployment-file-contents) is also not working at all. But I've discovered that if you use `get` in place of `{fileId}` and pass in `path={encoded file path}` as a query parameter, it seems to respond for some files which I refer to as v7 files.
3. Some files need to be read through undocumented `v6` endpoint and requires `outputs` instead of `get` in `{fileId}` and `file` instead of `path` query parameter. But only some files work through v6 API. I don't know which files are v6 and which are v7. Both of these APIs respond wildly differently.
4. The [teams endpoint](https://vercel.com/docs/rest-api/endpoints/teams#create-a-team) is unavailable for tokens obtained through [Vercel Integrations OAuth](https://vercel.com/docs/rest-api/vercel-api-integrations). I suspect I need to configure my integration to access it, but I haven’t been able to figure out how.

These are the major blockers I’m facing. There are also minor issues like incorrect or undocumented field names and value types in the documentation, but those were easier to debug and work around.

Any help would be appreciated. Thanks.

EDIT: In case this is useful or adds to the context, the integration I’m building is a VSCode extension. You can find more information on github.com/kyswtn/vscode-vercel.


Pauline P. Narvas (@pawlean) · 2024-10-04

Hi, @kyswtn! Welcome to the Vercel Community :smile: 

It's awesome to hear about the VSCode extension that you're building! I'd love to continue to hear the progress that you're making on it - feel free to keep sharing.

Actually would love to get your thoughts on something we're launching soon - I'll send you over a private message. :pray: 

Thanks again for your patience!


Pauline P. Narvas (@pawlean) · 2024-10-07 · ♥ 1

@kyswtn I'm just catching up with messages from the weekend and wanted to say congrats on getting our CEO to tweet your project :smile: 

https://x.com/rauchg/status/1843015409148268665


Kyaw (@kyswtn) · 2024-10-10

Hello this isn't related to Vercel SDK yet. But 

1. Is there an API where I can get the team ID of an access token? My use case is that I recently added manual access token authentication mechanism. But these tokens can be generated to have access to only a single team. In that case I'd need to get a team ID as all the endpoints for projects or deployments under a team seem to require it. I found access token metadata API but it doesn't return team ID.
2. Am I right to assume that teamId is always required for projects under teams (that is not the user's `defaultTeam`), do I need to always pass it in? I currently don't. I'll have to fix a ton of my logic in it's required haha.

EDIT: For example currently `vscode-vercel://deployments/$deploymentId/$name.log` will open build logs as a file. If `teamId` is required that means I'll have to restructure the URL so that `teamId` is also included.


Kyaw (@kyswtn) · 2024-10-10

Also I'm not sure what this means, in "get deployment events" endpoint.

![image|690x271](upload://tHB6naelKrpYUIOHaAvi5NRVDcy.png)

Does it mean the endpoint will stream the response? Or something else? My deployments finish too fast for me to test it out. I'm trying to implement real time build logs view.


Pauline P. Narvas (@pawlean) · 2024-10-11

Thanks for getting back to me! 

I've asked the team internally, will loop back :pray:


Kyaw (@kyswtn) · 2024-10-17

Hello, another question, is there any documented spec on Vercel's IDs? For example, I currently know that teamId, projectId and deploymentId are case-sensitive and can contain the alphabet, digits and an underscore.

My use case is I'm trying to embed them into an URI and, because URIs can be both case-sensitive and insensitive depending on OS (macOS - insensitive, Linux - sensitive etc), I'll have to encode these IDs and replace uppercase letters with alternative letters. So I kinda need to know what characters won't be included in these IDs (and also length). Thanks!


Pauline P. Narvas (@pawlean) · 2024-12-10 · ♥ 1

Hey, @kyswtn!

Thank you for your question about Vercel's ID formats. I reached out internally for clarification, and here's what I learned:

1. `deploymentId` uses base58 encoding
2. `teamId` is a custom UID
3. `projectId` is also a custom UID

While Vercel uses base58 for many of our ID generations, it's not guaranteed for all entities. However, there is a shared character set across all IDs, which is:

`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`

This means that all Vercel IDs will only contain these characters, regardless of their specific type.

For your use case of embedding these IDs into URIs, you should be aware that URIs can be case-sensitive. Since these IDs can contain both uppercase and lowercase letters, you'll need to handle this carefully when encoding them for use in URIs.

Does this help?


Kyaw (@kyswtn) · 2024-12-10

> Does this help?

It does. Thanks.

https://community.vercel.com/t/problems-with-vercel-rest-api/1207/6

Please help me out with this one too. This is a major blocker for me at the moment. Thanks again!


Pauline P. Narvas (@pawlean) · 2024-12-10

> **Is there an API to retrieve the team ID from an access token?**

No, the `teamId` is stored internally within the scope of the token, but there is no API available to directly request the scope of a token.

> **Is the `teamId` always required to access projects under a team (when it’s not the user’s default team)?**

Yes, the `teamId` is always required when accessing single resources by their ID.

> **Does the current lack of a required `teamId` in the URL structure imply they need to restructure their URLs?**

Yes, as mentioned earlier, accessing single resources by ID almost always requires the `teamId`. Including the `teamId` in the URI representation could be a good approach since there are no plans to change this requirement in the foreseeable future.

Let us know if you have any other qs!


system (@system) · 2026-01-20

Hi @kyswtn! 🔔

This thread's been quiet for a while. If you're still facing issues, please share any relevant details (logs, screenshots, error messages) so we can take another look!