# Help with the API regarding deploys

**URL:** <https://answers.netlify.com/t/help-with-the-api-regarding-deploys/1880>\
**Category:** Support\
**Tags:** netlify-api, deployment\
**Created:** [July 5, 2019, 7:54pm UTC](https://answers.netlify.com/t/help-with-the-api-regarding-deploys/1880 "2019-07-05T19:54:18Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![aguilaair](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/aguilaair/32/1631_2.png) [@aguilaair](https://answers.netlify.com/u/aguilaair)\
**Post date:** [July 5, 2019, 7:54pm UTC](https://answers.netlify.com/t/help-with-the-api-regarding-deploys/1880/1 "2019-07-05T19:54:18Z")

</div>

Hey!

So quick question about the API: I’m attempting to deploy a site which requires a command to be run in order to be built. I uploaded the zip file and netlify unpacks it correctly. The zip file contains a netlify.toml file where the build command and the deploy directory is stated. What command and args should I give the API in order to build with those arguments?

The TOML is:

```
[build]
  command = "yarn run generate"
  publish = "dist"

```

Thanks!

---

<div class="post-metadata">

**Author:** ![luke](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/luke/32/39_2.png) [@luke](https://answers.netlify.com/u/luke)\
**Post date:** [July 8, 2019, 8:55am UTC](https://answers.netlify.com/t/help-with-the-api-regarding-deploys/1880/2 "2019-07-08T08:55:10Z")

</div>

While this is a great question it is also not possible.

For the [manual deployment](https://www.netlify.com/docs/manual-deploys/) method no build command is run. The uploaded files are deployed as-is.

For a build process/command to be run, our [continuous deployment](https://www.netlify.com/docs/continuous-deployment/) is required.

---

<div class="post-metadata">

**Author:** ![garrettbland](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/garrettbland/32/2834_2.png) [@garrettbland](https://answers.netlify.com/u/garrettbland)\
**Post date:** [September 10, 2019, 9:40pm UTC](https://answers.netlify.com/t/help-with-the-api-regarding-deploys/1880/4 "2019-09-10T21:40:23Z")

</div>

Hi @aguilaair,

Do you mind sharing the code you used to get the zip file to upload and unpack? I have gotten the file digest to working, but wanted to test out the zip file upload as well. I cannot figure out how to get it working. It just tries to unpack the zip file 5 times and then fails.

Thanks!

---

<div class="post-metadata">

**Author:** ![futuregerald](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/futuregerald/32/33_2.png) [@futuregerald](https://answers.netlify.com/u/futuregerald)\
**Post date:** [September 12, 2019, 9:18pm UTC](https://answers.netlify.com/t/help-with-the-api-regarding-deploys/1880/5 "2019-09-12T21:18:20Z")

</div>

Hi @garrettbland, we have an example in our [docs](https://www.netlify.com/docs/api/#deploying-via-zip-file). However, we recommend deploying via the digest method because then we’ll ONLY upload the changed files. When you do a zip upload then you have to upload every file included in the deploy.

---

<div class="post-metadata">

**Author:** ![garrettbland](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/garrettbland/32/2834_2.png) [@garrettbland](https://answers.netlify.com/u/garrettbland)\
**Post date:** [September 12, 2019, 10:13pm UTC](https://answers.netlify.com/t/help-with-the-api-regarding-deploys/1880/6 "2019-09-12T22:13:24Z")

</div>

Thanks @futuregerald! I’m still trying to wrap my head around the digest method completely and netlifys build process. So for example, lets say I have a simple website with the following files.

```
index.html
about.html
contact.html

```

I make a change to the `about.html` file. So the next step is to create a new deploy with just that single file being required? Or do I still need to make sure all three files are required, but then only have to upload that single file with the new SHA1 hash?

---

<div class="post-metadata">

**Author:** ![luke](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/luke/32/39_2.png) [@luke](https://answers.netlify.com/u/luke)\
**Post date:** [September 18, 2019, 10:29am UTC](https://answers.netlify.com/t/help-with-the-api-regarding-deploys/1880/7 "2019-09-18T10:29:15Z")

</div>

@garrettbland, this is covered [here](https://www.netlify.com/docs/api/#deploying-via-files-digest).

When creating the content for digest of file paths and SHA1s, all files which are part of the deploy should be included.

The API will then reply with a JSON object where with a key “required”. The value for this key will be an array of SHA1s which are required to complete the deploy. Only the files which have their SHA1s in the “required” array need to be uploaded to complete the deploy.

Files not listed in that array already have an identical version deployed so uploading them again isn’t required.

---

<div class="post-metadata">

**Author:** ![David\_Davis](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/david_davis/32/3239_2.png) [@David\_Davis](https://answers.netlify.com/u/David_Davis)\
**Post date:** [October 2, 2019, 3:52am UTC](https://answers.netlify.com/t/help-with-the-api-regarding-deploys/1880/8 "2019-10-02T03:52:25Z")

</div>

@luke I feel the same pain @garrettbland does about not completely understanding the documentation in regards to using digest deployments. Furthermore if deploying via zip is not the recommended way then why are the only examples shown using zip and curl deploys? It would be really helpful to see an example of a file digest deployment using the API, just don’t know how many developers at the end of the day are using curl for deployments.

A final comment regarding Aguilar’s original post, I personally think it’s a shame we can’t have a manual deployment run a build step. Since you have examples of the ‘Deploy to Netlify’ buttons taking an unbuilt repository and building it in one step, you would think the API would be able to handle this. I’d like to see this be possible for manual deploys with the API.

---

<div class="post-metadata">

**Author:** ![garrettbland](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/garrettbland/32/2834_2.png) [@garrettbland](https://answers.netlify.com/u/garrettbland)\
**Post date:** [October 2, 2019, 7:39pm UTC](https://answers.netlify.com/t/help-with-the-api-regarding-deploys/1880/9 "2019-10-02T19:39:49Z")

</div>

Hi @David_Davis! I actually wrote a short tutorial on this a few weeks ago. If you have any questions please let me know, I (_feel like_) I have a pretty decent grasp on this now. I linked my reply below.

Another good thing to keep in mind about Netlify, is that the entire dashboard utilizes the same API. Check out the console/networking in chrome dev tools and you can see it all in action. Pretty sweet! 👏

> [@Deploying a site using the file digest API](https://answers.netlify.com/t/deploying-a-site-using-the-file-digest-api/3309/6):
>
> Figured this out for anyone who’s wondering. I’ve outlined the basic steps to update a single, index.html file and the process. I am using Postman on an iMac, incase thats relevant. Not going through authorization setup either. Create new deploy for your site. You will need to generate the sha1 of the file. On my mac the command is shasum index.html Once you have your sha1, you will pass that into your POST to create the new deploy in the files object as application/json. Example below of wha…

---

<div class="post-metadata">

**Author:** ![garrettbland](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/garrettbland/32/2834_2.png) [@garrettbland](https://answers.netlify.com/u/garrettbland)\
**Post date:** [October 2, 2019, 7:40pm UTC](https://answers.netlify.com/t/help-with-the-api-regarding-deploys/1880/10 "2019-10-02T19:40:57Z")

</div>

Good to know, thanks @luke!
