//native
type Render = {
apiKey: string
}
/**
* Retrieve workspace
* Retrieve the workspace with the provided ID.
Workspace IDs start with `tea-`. If you provide a user ID (starts with `own-`), this endpoint returns the user's default workspace.
*/
export async function main(auth: Render, ownerId: string) {
const url = new URL(`https://api.render.com/v1/owners/${ownerId}`)
const response = await fetch(url, {
method: 'GET',
headers: {
Authorization: 'Bearer ' + auth.apiKey
},
body: undefined
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.json()
}
Submitted by hugo697 235 days ago