@@ -42,7 +42,6 @@ Create a new project with the `name` request parameter. If the project already e
42
42
<Code lang = " json" >{ ` {
43
43
"id":"QmQKrt94KYKF3sDysJq19N87uMmE8Wicbt2GirePy1dH8U",
44
44
"name":"a-project-name",
45
- "alias": [],
46
45
"accountId":"K4amb7K9dAt5R2vBJWF32bmY",
47
46
"updatedAt":1555413045188,
48
47
"createdAt":1555413045188
@@ -79,7 +78,6 @@ Create a project with the `name` request parameter if it does not already exist.
79
78
<Code lang = " json" >{ ` {
80
79
"id":"QmQKrt94KYKF3sDysJq19N87uMmE8Wicbt2GirePy1dH8U",
81
80
"name":"a-project-name",
82
- "alias": [],
83
81
"accountId":"K4amb7K9dAt5R2vBJWF32bmY",
84
82
"updatedAt":1555413045188,
85
83
"createdAt":1555413045188
@@ -115,18 +113,20 @@ Get a list of all the projects you currently have under your account.
115
113
{
116
114
"id":"QmQKrt94KYKF3sDysJq19N8gvhmE8Wicbt2GirePy1dH8U",
117
115
"name":"a-project-name",
118
- "alias": [],
119
116
"accountId":"K4amb7K9dAt5R2vBJWF32bmY",
120
117
"createdAt":1555413045188,
121
- "updatedAt":1555413045188
118
+ "updatedAt":1555413045188,
119
+ "targets": {},
120
+ "latestDeployments": []
122
121
},
123
122
{
124
123
"id":"QmRhxc9HAmRMcLvWhCAf2ALLctxZ4s4fwsM1D5kNM8PJuL",
125
124
"name":"another-project-name",
126
- "alias": [],
127
125
"accountId":"K4amb7K9dAt5R2vBJWF32bmY",
128
126
"createdAt":1555072968396,
129
- "updatedAt":1555345633993
127
+ "updatedAt":1555345633993,
128
+ "targets": {},
129
+ "latestDeployments": []
130
130
}
131
131
]
132
132
` } </Code >
@@ -148,6 +148,20 @@ Get the information for a specific project by passing either the project `id` or
148
148
| ** id** | <HelpLink href = " #api-basics/types" >ID</HelpLink > | No | The unique project identifier. |
149
149
| ** name** | <HelpLink href = " #api-basics/types" >String</HelpLink > | No | The project name. |
150
150
151
+ #### Response Parameters
152
+
153
+ | Key | <HelpLink href = " #api-basics/types" hasIcon >Type</HelpLink > | Description |
154
+ | --------------------- | ---------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
155
+ | ** id** | <HelpLink href = " #api-basics/types" >ID</HelpLink > | A string holding the unique ID of the project. |
156
+ | ** name** | <HelpLink href = " #api-basics/types" >String</HelpLink > | The name of the project. |
157
+ | ** alias** | <HelpLink href = " #api-basics/types" >List</HelpLink > | A list of production domains for the project. |
158
+ | ** accountId** | <HelpLink href = " #api-basics/types" >String</HelpLink > | The unique ID of the user or team the project belongs to. |
159
+ | ** createdAt** | <HelpLink href = " #api-basics/types" >Date</HelpLink > | A number containing the date when the project was created in milliseconds. |
160
+ | ** updatedAt** | <HelpLink href = " #api-basics/types" >Date</HelpLink > | A number containing the date when the project was updated in milliseconds. |
161
+ | ** env** | <HelpLink href = " #api-basics/types" >List</HelpLink > | A list of environment variables configured for the project. |
162
+ | ** targets** | <HelpLink href = " #api-basics/types" >Map</HelpLink > | An object which has a ` production ` key containing the production deployment object, if a production deployment exists |
163
+ | ** latestDeployments** | <HelpLink href = " #api-basics/types" >List</HelpLink > | A list of the latest deployments for the project |
164
+
151
165
##### Example Request
152
166
153
167
<Request url = " https://api.zeit.co/v1/projects/a-project-name" auth />
@@ -157,10 +171,85 @@ Get the information for a specific project by passing either the project `id` or
157
171
<Code lang = " json" >{ ` {
158
172
"id":"QmQKrt94KYKF3sDysJq19N8gvhmE8Wicbt2GirePy1dH8U",
159
173
"name":"a-project-name",
160
- "alias": [],
174
+ "alias": [
175
+ {
176
+ "createdAt": 1555413045188,
177
+ "domain": "foobar.com",
178
+ "target": "PRODUCTION",
179
+ "configuredBy": "A",
180
+ "configuredChangedAt": 1555413045188
181
+ }
182
+ ],
161
183
"accountId":"K4amb7K9dAt5R2vBJWF32bmY",
162
184
"createdAt":1555413045188,
163
- "updatedAt":1555413045188
185
+ "updatedAt":1555413045188,
186
+ "env": [
187
+ {
188
+ "key": "API_SECRET",
189
+ "value": "@a-new-secret",
190
+ "configurationId": null,
191
+ "updatedAt": 1557241361455,
192
+ "createdAt": 1557241361455
193
+ }
194
+ ],
195
+ "targets": {
196
+ "production": {
197
+ "alias": [
198
+ "foobar.com"
199
+ ],
200
+ "aliasAssigned": 1571239348998,
201
+ "builds": [
202
+ {
203
+ "use": "@now/static",
204
+ "src": "**"
205
+ }
206
+ ],
207
+ "createdAt": 1571239348998,
208
+ "createdIn": "sfo1",
209
+ "deploymentHostname": "a-project-name-rjtr4pz3f",
210
+ "forced": false,
211
+ "id": "dpl_89qyp1cskzkLrVicDaZoDbjyHuDJ",
212
+ "meta": {},
213
+ "plan": "unlimited",
214
+ "private": true,
215
+ "readyState": "READY",
216
+ "requestedAt": 1571239348998,
217
+ "target": "production",
218
+ "teamId": null,
219
+ "type": "LAMBDAS",
220
+ "url": "a-project-name-rjtr4pz3f.now.sh",
221
+ "userId": "K4amb7K9dAt5R2vBJWF32bmY"
222
+ }
223
+ },
224
+ "latestDeployments": [
225
+ {
226
+ "alias": [
227
+ "foobar.com"
228
+ ],
229
+ "aliasAssigned": 1571239348998,
230
+ "builds": [
231
+ {
232
+ "use": "@now/static",
233
+ "src": "**"
234
+ }
235
+ ],
236
+ "createdAt": 1571239348998,
237
+ "createdIn": "sfo1",
238
+ "deploymentHostname": "a-project-name-rjtr4pz3f",
239
+ "forced": false,
240
+ "id": "dpl_89qyp1cskzkLrVicDaZoDbjyHuDJ",
241
+ "meta": {},
242
+ "plan": "unlimited",
243
+ "private": true,
244
+ "readyState": "READY",
245
+ "requestedAt": 1571239348998,
246
+ "target": "production",
247
+ "teamId": null,
248
+ "type": "LAMBDAS",
249
+ "url": "a-project-name-rjtr4pz3f.now.sh",
250
+ "userId": "K4amb7K9dAt5R2vBJWF32bmY"
251
+ }
252
+ ]
164
253
} ` } </Code >
165
254
166
255
### Remove a Single Project
@@ -218,8 +307,9 @@ Retrieve the environment variables for a given project by passing the project `i
218
307
{
219
308
"key": "API_SECRET",
220
309
"value": "@a-new-secret",
221
- "installationId": null,
222
- "updatedAt": 1557241361455
310
+ "configurationId": null,
311
+ "updatedAt": 1557241361455,
312
+ "createdAt": 1557241361455
223
313
}
224
314
] ` } </Code >
225
315
@@ -256,6 +346,9 @@ Create a new environment variable for the project by passing the project `id` in
256
346
<Request
257
347
method = " POST"
258
348
url = " https://api.zeit.co/v1/projects/QmXtXGhXF6mZQ5ete2AwbeV3zAS17wEj7LYM3LuQ3Y45FF/env"
349
+ headers = { {
350
+ ' Content-Type' : ' application/json'
351
+ }}
259
352
auth
260
353
body = { {
261
354
key: ' API_SECRET' ,
@@ -269,8 +362,9 @@ Create a new environment variable for the project by passing the project `id` in
269
362
{
270
363
"key": "API_SECRET",
271
364
"value": "@a-new-secret",
272
- "installationId": null,
273
- "updatedAt": 1557241361455
365
+ "configurationId": null,
366
+ "updatedAt": 1557241361455,
367
+ "createdAt": 1557241361455
274
368
}
275
369
] ` } </Code >
276
370
@@ -279,65 +373,10 @@ Create a new environment variable for the project by passing the project `id` in
279
373
</Note >
280
374
281
375
<Note >
282
- The <InlineCode >installationId </InlineCode > depends on the token used to make
376
+ The <InlineCode >configurationId </InlineCode > depends on the token used to make
283
377
the request.
284
378
</Note >
285
379
286
- ### Replace a Project Environment Variable
287
-
288
- <Endpoint method = " PUT" url = " /v1/projects/:id/env" />
289
-
290
- Set all environment variables for the project by passing the project ` id ` in the URL and an ` env ` map as a request parameter. Any env variable that is present in the project but not given in the payload will be removed.
291
-
292
- <Note >
293
- For security, only secrets can be used for these environment variables.
294
- </Note >
295
-
296
- <Note >
297
- Only deployments made after this call will receive the environment variables
298
- set.
299
- </Note >
300
-
301
- #### URL Parameters
302
-
303
- | Key | <HelpLink href = " #api-basics/types" hasIcon >Type</HelpLink > | Required | Description |
304
- | ------ | ---------------------------------------------------------- | -------- | ------------------------------ |
305
- | ** id** | <HelpLink href = " #api-basics/types" >ID</HelpLink > | Yes | The unique project identifier. |
306
-
307
- #### Request Parameters
308
-
309
- | Key | <HelpLink href = " #api-basics/types" hasIcon >Type</HelpLink > | Required | Description |
310
- | ------- | ---------------------------------------------------------- | -------- | -------------------------------------- |
311
- | ** env** | <HelpLink href = " #api-basics/types" >Map</HelpLink > | Yes | A set of secret environment variables. |
312
-
313
- ##### Example Request
314
-
315
- <Request
316
- method = " PUT"
317
- url = " https://api.zeit.co/v1/projects/QmXtXGhXF6mZQ5ete2AwbeV3zAS17wEj7LYM3LuQ3Y45FF/env"
318
- auth
319
- body = { {
320
- env: {
321
- API_SECRET: ' @a-new-secret'
322
- }
323
- }}
324
- />
325
-
326
- ##### Example Response
327
-
328
- <Code lang = " json" >{ ` [
329
- {
330
- "key": "API_SECRET",
331
- "value": "@a-new-secret",
332
- "installationId": null,
333
- "updatedAt": 1557241361455
334
- }
335
- ] ` } </Code >
336
-
337
- <Note >
338
- The response will include all environment variables for the project.
339
- </Note >
340
-
341
380
### Delete a Specific Environment Variable
342
381
343
382
<Endpoint method = " DELETE" url = " /v1/projects/:id/env/:key" />
@@ -372,7 +411,7 @@ Delete a specific environment variable for a given project by passing both the p
372
411
373
412
<Endpoint method = " POST" url = " /v1/projects/:id/alias" />
374
413
375
- Add a domain to the project by passing the project ` id ` in the URL and ` domain ` as request parameters.
414
+ Add a domain to the project by passing the project ` id ` in the URL and the ` domain ` and ` redirect ` as request parameters. If the domain already exists on the project, fails with ` 400 ` status code .
376
415
377
416
#### URL Parameters
378
417
@@ -387,27 +426,49 @@ Add a domain to the project by passing the project `id` in the URL and `domain`
387
426
| ** domain** | <HelpLink href = " #api-basics/types" >String</HelpLink > | Yes | The name of the production domain. |
388
427
| ** redirect** | <HelpLink href = " #api-basics/types" >String</HelpLink > | No | Target destination domain for redirect |
389
428
429
+ <Note >You can only redirect to domains that belong to the project.</Note >
430
+
390
431
##### Example Request
391
432
392
433
<Request
393
434
method = " POST"
394
435
url = " https://api.zeit.co/v1/projects/QmXtXGhXF6mZQ5ete2AwbeV3zAS17wEj7LYM3LuQ3Y45FF/alias"
436
+ headers = { {
437
+ ' Content-Type' : ' application/json'
438
+ }}
395
439
auth
396
440
body = { {
397
441
domain: ' foobar.com' ,
398
442
redirect: null
399
443
}}
400
444
/>
401
445
402
- ##### Example Response
446
+ ##### Example Response (successful)
403
447
404
448
<Code lang = " json" >{ ` [
405
449
{
406
450
"createdAt": 1562119110860,
407
- "domain": "foobar.com"
451
+ "domain": "foobar.com",
452
+ "target": "PRODUCTION",
453
+ "configuredBy": "A",
454
+ "configuredChangedAt": 1562119110860
408
455
}
409
456
] ` } </Code >
410
457
458
+ ##### Example response (unsuccessful)
459
+
460
+ <Code lang = " json" >{ ` {
461
+ "error": {
462
+ "code": "ALIAS_DOMAIN_EXIST",
463
+ "domain": "foobar.com",
464
+ "project": {
465
+ "id": "QmXtXGhXF6mZQ5ete2AwbeV3zAS17wEj7LYM3LuQ3Y45FF",
466
+ "name": "a-project-name",
467
+ "accountId": "K4amb7K9dAt5R2vBJWF32bmY",
468
+ }
469
+ }
470
+ } ` } </Code >
471
+
411
472
<Note >
412
473
The response will include all production domains configured for the project.
413
474
</Note >
@@ -432,13 +493,14 @@ Set redirect from specified domain to a different domain in the same project (st
432
493
433
494
#### Request Parameters
434
495
435
- | Key | <HelpLink href = " #api-basics/types" hasIcon >Type</HelpLink > | Required | Description |
436
- | ------------ | ---------------------------------------------------------- | -------- | -------------------------------------- |
437
- | ** domain** | <HelpLink href = " #api-basics/types" >String</HelpLink > | Yes | The name of the production domain. |
496
+ | Key | <HelpLink href = " #api-basics/types" hasIcon >Type</HelpLink > | Required | Description |
497
+ | ------------ | ---------------------------------------------------------- | -------- | --------------------------------------- |
498
+ | ** domain** | <HelpLink href = " #api-basics/types" >String</HelpLink > | Yes | The name of the production domain. |
438
499
| ** redirect** | <HelpLink href = " #api-basics/types" >String</HelpLink > | No | Target destination domain for redirect. |
439
500
440
- <Example >
441
- <span >Example request:</span >
501
+ <Note >You can only redirect to domains that belong to the project.</Note >
502
+
503
+ ##### Example Request
442
504
443
505
<Request
444
506
method = " PATCH"
@@ -450,14 +512,13 @@ Set redirect from specified domain to a different domain in the same project (st
450
512
}}
451
513
/>
452
514
453
- Example response:
515
+ ##### Example response:
454
516
455
517
<Code lang = " json" >{ ` [
456
518
{
457
519
"createdAt": 1571138625066,
458
520
"domain": "foobar.com",
459
521
"target": "PRODUCTION",
460
- "redirect": null,
461
522
"configuredBy": "A",
462
523
"configuredChangedAt": 1571945629322
463
524
},
@@ -470,7 +531,6 @@ Example response:
470
531
"configuredChangedAt": 1571945629501
471
532
}
472
533
] ` } </Code >
473
- </Example >
474
534
475
535
<Note >
476
536
The response will include all production domains configured for the project.
@@ -499,6 +559,12 @@ Delete a specific production domain configuration from a project by passing the
499
559
| ------ | ---------------------------------------------------------- | -------- | ------------------------------ |
500
560
| ** id** | <HelpLink href = " #api-basics/types" >ID</HelpLink > | Yes | The unique project identifier. |
501
561
562
+ #### Query Parameters
563
+
564
+ | Key | <HelpLink href = " #api-basics/types" hasIcon >Type</HelpLink > | Required | Description |
565
+ | ---------- | ---------------------------------------------------------- | -------- | ---------------------------------- |
566
+ | ** domain** | <HelpLink href = " #api-basics/types" >String</HelpLink > | Yes | The name of the production domain. |
567
+
502
568
##### Example Request
503
569
504
570
<Request
0 commit comments