# Initialization failed from netlify api

**URL:** <https://answers.netlify.com/t/initialization-failed-from-netlify-api/110284>\
**Category:** Support\
**Tags:** netlify-api, building, deployment\
**Created:** [January 13, 2024, 9:00am UTC](https://answers.netlify.com/t/initialization-failed-from-netlify-api/110284 "2024-01-13T09:00:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sandhusaab](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@sandhusaab](https://answers.netlify.com/u/sandhusaab)\
**Post date:** [January 13, 2024, 9:00am UTC](https://answers.netlify.com/t/initialization-failed-from-netlify-api/110284/1 "2024-01-13T09:00:30Z")

</div>

I am trying to push code from github to the netlify. I am using following code to do this

url = “[https://api.netlify.com/api/v1/sites](https://api.netlify.com/api/v1/sites)”  
headers = {  
“Authorization”: f"Bearer \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_",  
“Content-Type”: “application/json”,  
}  
data = {  
# “repo”: {“repo\_url”: repo\_url},  
“name”: “caahasaaakooo”, # Replace with your desired site name,  
“repo”: {  
“branch”: “main”,  
“private”: False,  
“provider”: “github”,  
“repo”: “dsfsdf”,  
“public\_repo”: True  
},  
“build\_settings”: {  
“branch”: “main”,  
“private”: False,  
“provider”: “github”,  
“repo”: “sdfsdfsdff”,  
“public\_repo”: True  
}  
}

i am getting following error

[Build troubleshooting tips | Netlify Docs](https://docs.netlify.com/configure-builds/troubleshooting-tips/#build-fails-with-error-128:) Host key verification failed.

fatal: Could not read from remote repository

Connection is there i checked in the site created

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [January 13, 2024, 5:24pm UTC](https://answers.netlify.com/t/initialization-failed-from-netlify-api/110284/2 "2024-01-13T17:24:17Z")

</div>

Have you followed this from start to finish:

> [@\[Support Guide\] Linking a repository via API](https://answers.netlify.com/t/121):
>
> Last reviewed by Netlify Support Staff: August 2023 It is easiest to link a repository in Netlify’s UI; doing it via API is challenging and should be a rare use case. Nonetheless, it is possible to create a Netlify site linked to a repository at any of our supported git providers programatically. Specifically, it is possible to use Netlify’s REST API for these situations. You’ll probably be interested in the general topics around “how do I use Netlify’s REST API?” (see [this support guide](https://answers.netlify.com/t/support-guide-understanding-and-using-netlifys-api/160), as w…

---

<div class="post-metadata">

**Author:** ![sandhusaab](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@sandhusaab](https://answers.netlify.com/u/sandhusaab)\
**Post date:** [January 15, 2024, 6:36pm UTC](https://answers.netlify.com/t/initialization-failed-from-netlify-api/110284/3 "2024-01-15T18:36:36Z")

</div>

Yes i tried everything as mentioned, passed deploy id as well, still getting same error

---

<div class="post-metadata">

**Author:** ![SamO](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/samo/32/41847_2.png) [@SamO](https://answers.netlify.com/u/SamO)\
**Post date:** [January 17, 2024, 6:03pm UTC](https://answers.netlify.com/t/initialization-failed-from-netlify-api/110284/4 "2024-01-17T18:03:41Z")

</div>

Hi 👋🏿 I can’t locate your account can you please share your slug.
